Skip to content

fix: preserve user token namespace on refresh - #215

Open
dajiaohuang wants to merge 1 commit into
larksuite:mainfrom
dajiaohuang:fix/210-user-token-namespace
Open

fix: preserve user token namespace on refresh#215
dajiaohuang wants to merge 1 commit into
larksuite:mainfrom
dajiaohuang:fix/210-user-token-namespace

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Why

UserAccessToken.get(key, { namespace }) reads from the requested namespace, but both successful recovery paths wrote the refreshed token without forwarding that namespace. The custom namespace stayed expired, so subsequent reads refreshed again and the new token was stored under the app-ID namespace.

What changed

  • Forward the requested namespace when persisting refresh-token results.
  • Forward it for the authorization-code fallback as well.
  • Add regression tests proving two reads from a custom namespace perform only one refresh/code exchange.

Validation

  • corepack yarn test --runInBand client/__tests__/user-access-token.test.ts — 2 passed
  • corepack yarn test --runInBand — 47 suites passed; 447 passed, 5 skipped
  • git diff --check

Closes #210

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.

UserAccessToken.get ignores a custom namespace when persisting refreshed tokens

1 participant