Skip to content

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

Open
Xyphyn wants to merge 1 commit intomainfrom
restructure/hybrid-ssr-auth
Open

restructure: update user data handling to allow server-side authentication#693
Xyphyn wants to merge 1 commit intomainfrom
restructure/hybrid-ssr-auth

Conversation

@Xyphyn
Copy link
Owner

@Xyphyn Xyphyn commented Nov 30, 2025

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--making things clunky for actual users.

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.

@cloudflare-workers-and-pages
Copy link

Deploying photon with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1dbe27b
Status:🚫  Build failed.

View logs

@Xyphyn Xyphyn changed the title restruct [1/?]: rewrite frontpage and layout to use userHost restructure: update user data handling to allow server-side authentication Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant