HotFix encrypted and decrypted error
Signed-off-by: Gregoire Parant <g.parant@thecodingmachine.com>
This commit is contained in:
@@ -80,10 +80,17 @@ export class MapController extends BaseController {
|
||||
authTokenData = jwtTokenManager.verifyJWTToken(query.authToken as string);
|
||||
userId = authTokenData.identifier;
|
||||
} catch (e) {
|
||||
// Decode token, in this case we don't need to create new token.
|
||||
authTokenData = jwtTokenManager.verifyJWTToken(query.authToken as string, true);
|
||||
userId = authTokenData.identifier;
|
||||
console.info("JWT expire, but decoded", userId);
|
||||
try {
|
||||
// Decode token, in this case we don't need to create new token.
|
||||
authTokenData = jwtTokenManager.verifyJWTToken(query.authToken as string, true);
|
||||
userId = authTokenData.identifier;
|
||||
console.info("JWT expire, but decoded", userId);
|
||||
} catch (e) {
|
||||
// The token was not good, redirect user on login page
|
||||
res.writeStatus("500");
|
||||
res.end("Token decrypted error");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
const mapDetails = await adminApi.fetchMapDetails(query.playUri as string, userId);
|
||||
|
||||
Reference in New Issue
Block a user