ITADN

restructure: update user data handling to allow server-side authentication

#693Pull RequestXyphyn 创建于 2025-11-30
X
Xyphyncommented
big branch: Photon currently is a client-side only app, with optional guest SSR. This works great as a web app, but not for SEO. While you can enable SSR for SEO, it is not authenticated and will lead to a flash of content from a guest user instead of your profile. this pr aims to do the following: - Rewrite app-side data to use a unified `userHost` object that can be filled with either data from a cookie, or localStorage. - this will allow for a hybrid mode, where you can either use server-side user data or client-side user data. - userHost data is stored in a JSON state, but can be loaded into reactive classes for the client/rendering. - Instead of using global state in the form of `profile` or `settings` objects, use Svelte's `getContext` and `setContext` to access this data. - Maintain a near-identical user experience for client-side instances, such as at phtn.app.
合并状态:未合并 1 条评论