-
Notifications
You must be signed in to change notification settings - Fork 8
How to add custom claims to the user object? #43
Copy link
Copy link
Open
Description
I have implemented Google OAuth in a Tanstack Start app.
What do I want?
I want to assign a default role named "regular" to every user who signs in and have that role available in the user object returned from getAuth().
I can assign a role inside the onSuccess handler:
export const Route = createFileRoute('/api/auth/callback')({
server: {
handlers: {
GET: handleCallbackRoute({onSuccess(data) {
// Assign a role to the user and save the user in DB.
},}),
},
},
})
How do I make the role available in the user object? Is there any API available?
Supabase Auth provides Auth Hooks for adding custom claims. Is there anything similar in the Authkit Tanstack Start SDK?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels