Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change logic to preserve token #433

Merged
merged 3 commits into from
Oct 7, 2024
Merged

Change logic to preserve token #433

merged 3 commits into from
Oct 7, 2024

Conversation

marcospassos
Copy link
Member

Summary

Here’s an improved version of your description:

Before this PR, passing userId as null would clear the token, even if the current token was anonymous. This caused issues for organizations with multiple applications, where some use signed tokens and others do not. For those not using signed tokens, passing null would generate an unsigned token, which lacks a token ID and initiates a new session.

With this update, the token is only regenerated if the subject changes. To retain the previous behavior, use token: null instead.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@marcospassos marcospassos added the bug Something isn't working label Oct 7, 2024
Copy link

pkg-pr-new bot commented Oct 7, 2024

Open in Stackblitz

npm i https://pkg.pr.new/@croct/sdk@433

commit: 5233dd8

Copy link

codeclimate bot commented Oct 7, 2024

Code Climate has analyzed commit 5233dd8 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 99.9% (0.0% change).

View more on Code Climate.

@marcospassos marcospassos merged commit 2d20534 into master Oct 7, 2024
6 of 7 checks passed
@marcospassos marcospassos deleted the preserve-token branch October 7, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants