question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting useUser.user updated when app_metadata changes

See original GitHub issue

Describe the problem you’d like to have solved

Hi All, love the framework.

I need to get the client to check for changes in the idToken and accessToken once in a while.

using the kitchen-sink-example it takes a logout and a login in order to get any changes down to the client.

Im having a hard time understanding the whole space around “checksession” “refresh tokens”, some examples that is named my-handler that doesnt return anything. I think i read most of the documentation and i still cant get anything to work. Is this possible, and do you have any workable examples or hints on this?

Describe the ideal solution

I would like to get a new idToken at least on page refresh so like

useEffect( ()=> refresh() , [])

Alternatives and current work-arounds

I think this should be baked in, otherwise the whole app_metadata thing is pretty pointless. I just cant figure it out

Additional information, if any

Thank you

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
arbejdcommented, Mar 24, 2022

Ok for future reference i just made a function on api/refresh and did what this comment suggested.

Thank you @adamjmcgrath !

Hi @arbejd

I need to get the client to check for changes in the idToken and accessToken once in a while.

The authorization server issues ID Tokens and Access Tokens, so the only way to get new ones is to login again (you can use prompt=none to do this non interactively see #492 (comment))

0reactions
arbejdcommented, Apr 1, 2022

Thank you Adam, i will look into this

Read more comments on GitHub >

github_iconTop Results From Across the Web

useUser only gets metadata updates after new user logs out ...
I think there's a solution to fetch the updated metadata in React by using ignoreCache in getAccessTokenSilently.
Read more >
Managing User Data - Supabase
If the data should only be readable by the user who owns the data, we just need to change the for select query...
Read more >
Working with Auth0 User and App Metadata in Android Apps
Learn how to use user and app metadata in Auth0 user profiles to store additional information about your users.
Read more >
User | JavaScript SDK | Firebase JavaScript API reference
Reference for User. ... Creates the provider object. var provider = new firebase.auth. ... "Jane Q. User", hasn't changed. var displayName = user....
Read more >
ASO Monthly #61 May 2021: App Store Search Suggestions ...
April 29 – Google announced policy changes for app metadata and store listing ... May 4 – Apple Search Ads get a new...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found