We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In supabase adapter docs, when guiding on how to implement RLS, in this example code
callbacks: { async session({ session, user }) { const signingSecret = process.env.SUPABASE_JWT_SECRET if (signingSecret) { const payload = { aud: "authenticated", exp: Math.floor(new Date(session.expires).getTime() / 1000), sub: user.id, email: user.email, role: "authenticated", } session.supabaseAccessToken = jwt.sign(payload, signingSecret) } return session }, },
Docs says that there is a user prop which then gets used for making supabaseAccessToken, but this callback in my code only returns session and token.
I am using using google as provide and have a split setup to be able to use JWT in edge
This way of doing it worked for me.
export const { auth, handlers, signIn, signOut } = NextAuth({ session: { strategy: "jwt" }, adapter: SupabaseAdapter({ url: process.env.SUPABASE_URL, secret: process.env.SUPABASE_SERVICE_ROLE_KEY, }), callbacks: { async session({ session, token }) { const signingSecret = process.env.SUPABASE_JWT_SECRET; if (signingSecret) { const payload = { aud: "authenticated", exp: Math.floor(new Date(session.expires).getTime() / 1000), sub: token.sub, email: token.email, role: "authenticated", }; session.supabaseAccessToken = jwt.sign(payload, signingSecret); } return session; }, }, ...authConfig,
I am not sure if the token/user issue only applies to google or if it is the same with other providers, I did not check any other ones.
https://authjs.dev/getting-started/adapters/supabase?framework=next-js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What is the improvement or update you wish to see?
In supabase adapter docs, when guiding on how to implement RLS, in this example code
Docs says that there is a user prop which then gets used for making supabaseAccessToken, but this callback in my code only returns session and token.
Is there any context that might help us understand?
I am using using google as provide and have a split setup to be able to use JWT in edge
This way of doing it worked for me.
I am not sure if the token/user issue only applies to google or if it is the same with other providers, I did not check any other ones.
Does the docs page already exist? Please link to it.
https://authjs.dev/getting-started/adapters/supabase?framework=next-js
The text was updated successfully, but these errors were encountered: