mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-24 04:13:59 +02:00
Fall back to JWT exp claim when OAuth token response has no expires_in (#506)
This commit is contained in:
@@ -67,6 +67,7 @@ export async function getAuthorizationCode(
|
||||
clientId,
|
||||
clientSecret,
|
||||
credentialsInBody,
|
||||
tokenName,
|
||||
});
|
||||
if (token != null) {
|
||||
return token;
|
||||
|
||||
@@ -37,7 +37,7 @@ export async function getImplicit(
|
||||
authorizationUrl: authorizationUrlRaw,
|
||||
};
|
||||
const token = await getToken(ctx, tokenArgs);
|
||||
if (token != null && !isTokenExpired(token)) {
|
||||
if (token != null && !isTokenExpired(token, tokenName)) {
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ async function getTokenViaEmbeddedBrowser(
|
||||
|
||||
const response = Object.fromEntries(params) as unknown as AccessTokenRawResponse;
|
||||
try {
|
||||
resolve(storeToken(ctx, tokenArgs, response));
|
||||
resolve(storeToken(ctx, tokenArgs, response, tokenName));
|
||||
} catch (err) {
|
||||
reject(err);
|
||||
}
|
||||
@@ -195,5 +195,5 @@ async function extractImplicitToken(
|
||||
response.id_token = idToken;
|
||||
}
|
||||
|
||||
return storeToken(ctx, tokenArgs, response);
|
||||
return storeToken(ctx, tokenArgs, response, tokenName);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user