Skip to content

Add features for refresh token #356

@guilherme-codes

Description

@guilherme-codes

I'm having trouble handling refresh tokens because setUserSession doesn't update the session. So, I'm considering the possibility of adding options to setUserSession or returning an updateSession function along with the useUserSession composable.

Other ideas could be add options to refresh token in the route files... and maybe add the refresh token method to the providers definitions too.
I'd like to know people here think about this

P.S: I read the others topics talking about this issue and I think we don't have a good solution yet

// expose update session
const { updateSession } = useUserSession()

updateSession( {
  token: 'token',
   refresh_toke: 'token'
})
// allow session mutation by setUserSession
setUserSession(event, {
  token: 'token',
   refresh_toke: 'token'
}, { updateSession: true })
// add refreshtoken callback
export default defineOAuthAuth0EventHandler({
    async onSuccess(event, data) {},
    async onRefreshToken() {}
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions