Skip to content
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

deserializeUser function #1

Open
Mert18 opened this issue Mar 24, 2023 · 0 comments
Open

deserializeUser function #1

Mert18 opened this issue Mar 24, 2023 · 0 comments

Comments

@Mert18
Copy link

Mert18 commented Mar 24, 2023

https://github.com/TomDoesTech/JWT-Access-Refresh-Tokens/blob/main/finished/api/src/middleware/deserializeUser.ts#L5

deserializeUser function is not functioning correctly.

When the access token expires, so the client does not have it anymore, so our function enters

https://github.com/TomDoesTech/JWT-Access-Refresh-Tokens/blob/main/finished/api/src/middleware/deserializeUser.ts#L8

and leaves the function.

But instead we must have a structure such as:

if(!accessToken){
    if(!refreshToken){
        return next()
    }
    // handle refresh token and generate new access token using it.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant