Managing user sessions across platforms. (Wordpress migrating to Supabase)
We are migrating our platform from wordpress to Supabase/Next.js and we are planning to use feature flags to decide when a client is sent to the old platform vs the new one until full migration is handled. I have setup a subdomain for the next.js project.
I have found some
Is there something I am missing? or is this just not implemented. We are still early in the planning stage so I am open to suggestions.
I have found some
auth/v1 API endpoints however my question is handling the session across the 2 platforms. There doesnt seem to be a way to validate a session via the API. I am hoping to have a flow similar to this.- User signup or login on Next.js and Supabase. (Stores the session via JWT cookie to be used on both platforms.)
- When a user navigates away to a feature still hosted on Wordpress. (get the JWT access_token, refresh_token and make an api call to Supabase to validate or refresh if needed, returning that the user is authenticated and signed in storing the user session data for use within the wordpress features)
- When they navigate back to a new feature the session is just handled regularly by the middleware in Next.
Is there something I am missing? or is this just not implemented. We are still early in the planning stage so I am open to suggestions.