Hello everyone, Im a little new to Supabase. I am ...
# help
c
Hello everyone, Im a little new to Supabase. I am currently using Auth to allow users to sign up through Discord. I would like to extend the session data that is returned when I run the code below
Copy code
js
const { data: user, error } = await supabase.auth.api.getUser(
    req.cookies["sb:token"]
 );
I would like to add the users access token returned by the provider as i need it to interact with Discords API
The data that is returned from the code above looks like this
Copy code
json
{
"id": "uuid",
"aud": "authenticated",
"role": "authenticated",
"email": "email",
"email_confirmed_at": "2021-08-18T03:41:30.193671Z",
"phone": "",
"confirmed_at": "2021-08-18T03:41:30.193671Z",
"last_sign_in_at": "2021-08-18T18:46:02.790896Z",
"app_metadata": {
"provider": "discord"
},
"user_metadata": {
"avatar_url": "https://cdn.discordapp.com/avatars/387313922736259074/c853d6e80408c2dc9abdcae063810fb2.png",
"full_name": "Cartiers",
"provider_id": "387313922736259074"
},
"created_at": "2021-08-18T03:41:30.189454Z",
"updated_at": "2021-08-18T03:41:30.189454Z"
}
if i were to need the Users guilds I lack their access token given by the provider on sign-up/login
Figured it out. I just gotta use
Copy code
js
const { user, error } = await supabase.auth.update({
      data: { hello: "world" },
});
Itll add to user_metadata