Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best way to integrate third party auth solutions with nuxt supabase? #378

Open
murphypetercl opened this issue Jun 21, 2024 · 0 comments
Open
Labels
question Further information is requested

Comments

@murphypetercl
Copy link

From various sources it seems that the correct way to connect to supabase when using third party auth solutions such as Stytch or Clerk is to provide a jwt token in the bearer authorization as follows using the @supabase/supabase-js package:

import { createClient } from "@supabase/supabase-js";

const supabase = createClient(
config.public.supabaseUrl,
config.public.supabaseKey,
{
global: {
headers: {
Authorization: Bearer ${jwtToken},
},
},
},
);

It works but I call the above in multiple pages and see the "Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key."

Is there a better way with nuxt/supabase to dynamically set the token after login and to have the client globally available across the app without creating a new one on each page?

@murphypetercl murphypetercl added the question Further information is requested label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant