immich icon indicating copy to clipboard operation
immich copied to clipboard

feat(web): improve layout + data flow admin pages

Open michelheusschen opened this issue 2 years ago • 3 comments

  • Added auth guard for admin pages to layout, so it doesn't need to be duplicated for all admin pages
  • Changes data flow from page to components to better utilize load() functions
  • Use existing meta.title for setting the page title

michelheusschen avatar Feb 27 '23 07:02 michelheusschen

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
immich ⬜️ Ignored (Inspect) Feb 27, 2023 at 7:36AM (UTC)

vercel[bot] avatar Feb 27 '23 07:02 vercel[bot]

This is a good video on not using layout for authentication https://www.youtube.com/watch?v=UbhhJWV3bmI&t=27s

I recall that is the reason why we are doing auth on each route. In the following-up video, the guy showed a way to centralize route auth on the handle hook. However, if that was the case, I prefer to explicitly perform the authentication on +page.server.ts

alextran1502 avatar Feb 27 '23 23:02 alextran1502

Meta

Ogrodneybaker avatar Feb 28 '23 02:02 Ogrodneybaker

Ran into some other edge cases while testing this further. We don't handle any sensitive data in our +page.server.ts files, so that shouldn't really be an issue. But I'm closing this one and I will open a new PR once I have revisited this.

michelheusschen avatar Feb 28 '23 19:02 michelheusschen