Skip to content

fix: use silentRequestTimeoutInSeconds for the refresh token grant - #2479

Open
basitalisandhu wants to merge 1 commit into
authts:mainfrom
basitalisandhu:fix/refresh-token-silent-timeout
Open

basitalisandhu wants to merge 1 commit into
authts:mainfrom
basitalisandhu:fix/refresh-token-silent-timeout

Conversation

@basitalisandhu

Copy link
Copy Markdown

Closes/fixes #2478

When the stored user has a refresh token and signinSilent() is called without silentRequestTimeoutInSeconds (which is how SilentRenewService calls it), _useRefreshToken got timeoutInSeconds: undefined from the args, and the spread overwrote the settings default. The refresh request then ran with no timeout, so a token endpoint that never answers left the renew pending and maxSilentRenewTimeoutRetries never kicked in.

I moved the default after the spread so an explicit value still wins. Added two tests (settings value used, args value preferred); the first one fails on main with timeoutInSeconds: undefined. npm test (574 passed) and npm run lint are clean.

Checklist

  • This PR makes changes to the public API
  • I have included links for closing relevant issue numbers

signinSilent() passed timeoutInSeconds: undefined to _useRefreshToken when
the caller gave no timeout, and the spread overwrote the default from the
settings, so the refresh grant had no timeout at all (SilentRenewService
always calls signinSilent() without args).

Fixes authts#2478

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

signinSilent() ignores silentRequestTimeoutInSeconds on the refresh-token path when called without arguments

1 participant