netlifyIdentity.on('init', (user) => {
if (user) {
user.jwt(true).then((token) => {
const parts = token.split('.')
const currentUser = JSON.parse(atob(parts[1]))
setUser((user) => ({
...user,
app_metadata: {
...currentUser.app_metadata,
},
}))
})
}
})
Created
January 8, 2021 11:45
-
-
Save Khaledgarbaya/d5425ef359b2ea5edee5424f7cc35525 to your computer and use it in GitHub Desktop.
Refersh netlify identity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment