immich
immich copied to clipboard
feat(web): improve layout + data flow admin pages
- 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.titlefor setting the page title
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) |
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
Meta
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.