-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT: Revoke Refresh Tokens on Session-Destroy #129
FEAT: Revoke Refresh Tokens on Session-Destroy #129
Conversation
Someone is attempting to deploy a commit to a Personal Account owned by @mazipan on Vercel. @mazipan first needs to authorize it. |
I don't think the destroy session is necessary in the current flow. Can you check, how if use previous token after doing logout? Since we already doing logout from Firebase client side, I assume that the old token can not be verified anymore. If it's safe, then we can remove the destroy session function completely. |
I will help to check from my local. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@mazipan I checked it again and I guess both the Scenario:
Turns out it's bigger topic than I expected. To make it ideal, need to introduce two things:
The approach is like documented here: Revoke refresh tokens
Now when we retest common flow above, it will be in ideal state.
|
Fixed the issue 💪🏻
📝 Ideally, the response should be } catch (error: any) {
console.error(request.url, error)
if (error.code === 'auth/id-token-revoked') {
// Token has been revoked. Inform the user to reauthenticate or signOut() the user.
return NextResponse.json(
{ message: 'Session has expired. Please log in again to continue.' },
{ status: 401 },
)
}
return NextResponse.json(
{ message: 'Error while get question by uid' },
{ status: 500 },
)
} |
a24a2ab
to
ef58e1f
Compare
Closes (#94)
Description
Tested on Logout ✅
📝 I haven't checked the Delete User flow, but I guess we need to Revoke the Refresh token there as well.
References: