Conversation
f5fb9f6 to
68868e6
Compare
68868e6 to
5126d4a
Compare
| findCompatibleActive(tokenSets, authorizationParams) { | ||
| return tokenSets.find( | ||
| (ts) => | ||
| !TokenSetUtils.isExpired(ts) && |
There was a problem hiding this comment.
these 3 methods findCompatibleActive, findCompatibleExpired findCompatibleRefreshable looks similar. Could we refactor this?
|
|
||
| /** @type {import('..').TokenSetParameters | undefined} */ | ||
| let found; | ||
|
|
There was a problem hiding this comment.
Shouldn't we consider the most recent token? Could you re-check this once.
| * small enough that a token can't possibly fit inside. | ||
| */ | ||
| const loggedOutCookies = await context.cookies(); | ||
| assert.isTrue(loggedOutCookies.find(({ name }) => name === 'appSession').size < 200); |
There was a problem hiding this comment.
here if loggedOutCookies.find does find the cookie it returns undefined
Shall we do something
const appSessionCookie = loggedOutCookies.find(({ name }) => name === 'appSession'); assert.isTrue(!appSessionCookie || appSessionCookie.size < 200);
There was a problem hiding this comment.
I think this is fixed now here. Some code was not expecting the possibility of optional props to actually be present in the tokenset but with a nullish value. This caused the cookie not to be properly cleared.
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Description
This PR adds support for Auth0's MRRT feature.
High-level overview of the changes this PR includes:
Aand I need a token for audienceB, I can do a refresh fromAtoB). Can be enabled with the newtokenHistoryoption, but it's disabled by default.authorizationParamsargument that will override the one set at the SDK level. This is not a breaking change since I included a compatibility layer that detects old vs. new arguments and normalizes them (seerequiresAuthLegacyArgs.js).useMrrtoption, to enable the potential usage of MRRT, depending on whatever it's in the token history. It requirestokenHistoryto be enabled and proper configuration in Auth0. Disabled by default.autoRefreshExpiredoption, to improve the DX when using MRRT. This way, requesting a series of tokens with different audiences/scopes to protect a route is a declarative operation, instead of having to check whether tokens are expired.Testing
Checklist