mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-08-20 09:44:06 -05:00
fix: use enum values for token property comparison
Some checks are pending
Build and Publish Docker Image / build-publish (push) Waiting to run
Some checks are pending
Build and Publish Docker Image / build-publish (push) Waiting to run
This commit is contained in:
@@ -112,7 +112,7 @@ export async function getPNIDByNNASAccessToken(token: string): Promise<HydratedP
|
||||
const unpackedToken = unpackToken(decryptedToken);
|
||||
|
||||
// * Return if the system type isn't Wii U (NNAS) and the token type isn't "OAuth Access"
|
||||
if (unpackedToken.system_type !== 1 || unpackedToken.token_type !== 1) {
|
||||
if (unpackedToken.system_type !== 'WIIU' || unpackedToken.token_type !== 'OAUTH_ACCESS') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ export async function getPNIDByNNASRefreshToken(token: string): Promise<Hydrated
|
||||
const unpackedToken = unpackToken(decryptedToken);
|
||||
|
||||
// * Return if the system type isn't Wii U (NNAS) and the token type isn't "OAuth Refresh"
|
||||
if (unpackedToken.system_type !== 1 || unpackedToken.token_type !== 2) {
|
||||
if (unpackedToken.system_type !== 'WIIU' || unpackedToken.token_type !== 'OAUTH_REFRESH') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ export async function getPNIDByAPIAccessToken(token: string): Promise<HydratedPN
|
||||
const unpackedToken = unpackToken(decryptedToken);
|
||||
|
||||
// * Return if the system type isn't API (REST and gRPC) and the token type isn't "OAuth Access"
|
||||
if (unpackedToken.system_type !== 3 || unpackedToken.token_type !== 1) {
|
||||
if (unpackedToken.system_type !== 'API' || unpackedToken.token_type !== 'OAUTH_ACCESS') {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ export async function getPNIDByAPIRefreshToken(token: string): Promise<HydratedP
|
||||
const unpackedToken = unpackToken(decryptedToken);
|
||||
|
||||
// * Return if the system type isn't API (REST and gRPC) and the token type isn't "OAuth Refresh"
|
||||
if (unpackedToken.system_type !== 3 || unpackedToken.token_type !== 2) {
|
||||
if (unpackedToken.system_type !== 'API' || unpackedToken.token_type !== 'OAUTH_REFRESH') {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user