Coder Social home page Coder Social logo

Comments (10)

J0 avatar J0 commented on August 20, 2024

Hey!

Thanks for the query. getSession typically checks for a local token which might be out of sync with the recently returned token. If you're looking to obtain an up to date token with custom claims would recommend that you update app_metadata in the Auth Hook and use getUser to obtain a fresh access token.

Alternatively, you could wait for a refresh event to happen and the new access token should show the claims, providing they were saved to the users table.

Hope this helps

from gotrue.

mr-menno avatar mr-menno commented on August 20, 2024

from gotrue.

J0 avatar J0 commented on August 20, 2024

Hey @mr-menno,

Sorry, I spoke with a colleague earlier today who and realized that I misunderstood this query. The REST response indeed does not return the claim but the signed access token does. We'll likely add it in the REST response for the next release

Thanks for flagging this!

from gotrue.

taytzehao avatar taytzehao commented on August 20, 2024

would like to take this

from gotrue.

mr-menno avatar mr-menno commented on August 20, 2024

from gotrue.

taytzehao avatar taytzehao commented on August 20, 2024

@mr-menno , could you show a precise example of it? Currently, when I run

const { data2, error2 } = await supabase.auth.updateUser({
    data: { hello: 'world5' }
  })

data2 is undefined. Do you mean this?

from gotrue.

mr-menno avatar mr-menno commented on August 20, 2024

from gotrue.

tzehaoo avatar tzehaoo commented on August 20, 2024

okay, creating the PR

from gotrue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.