mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-07-18 17:01:41 -05:00
feat: make OAuth refresh tokens single use
This commit is contained in:
parent
07fc399303
commit
822c8fb5ab
|
|
@ -137,6 +137,11 @@ async function getPNIDByOAuthToken(token: string, expectedSystemType: SystemType
|
|||
}
|
||||
}
|
||||
|
||||
// * Refresh tokens are single use
|
||||
if (expectedTokenType === TokenType.OAuthRefresh) {
|
||||
await oauthToken.deleteOne();
|
||||
}
|
||||
|
||||
return pnid;
|
||||
} catch (error: any) {
|
||||
// TODO - Handle error
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user