File tree 2 files changed +1
-3
lines changed
2 files changed +1
-3
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,7 @@ export const refreshAccessToken = async (refreshToken: string) => {
57
57
if ( response . ok ) {
58
58
return await response . json ( ) ;
59
59
}
60
- return ;
61
60
} catch ( error ) {
62
61
console . error ( 'Error during token refresh:' , error ) ;
63
- return ;
64
62
}
65
63
} ;
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ export const getAuthOptions = (req: GetServerSidePropsContext['req'] | NextApiRe
105
105
}
106
106
} else {
107
107
const tokenExpiresAtMs = token . account . expires_at * 1000 ;
108
- if ( Date . now ( ) > tokenExpiresAtMs ) {
108
+ if ( Date . now ( ) >= tokenExpiresAtMs ) {
109
109
// Access token has expired. Use the refresh token to obtain a new one.
110
110
const requestedNewToken = await refreshAccessToken ( token . account . refresh_token ) ;
111
111
token . account = {
You can’t perform that action at this time.
0 commit comments