Skip to content

Convert SessionToken to a String typealias#590

Merged
jhaven-stytch merged 3 commits intostytchauth:mainfrom
nidal-augment:session-tokens-cleanup
Feb 5, 2026
Merged

Convert SessionToken to a String typealias#590
jhaven-stytch merged 3 commits intostytchauth:mainfrom
nidal-augment:session-tokens-cleanup

Conversation

@nidal-augment
Copy link
Contributor

@nidal-augment nidal-augment commented Jan 9, 2026

After interacting with the SessionTokens and SessionToken objects as an external consumer I felt that distinguishing between the token types internally was of zero value. The SessionTokens object store 2 tokens, one for each type that is named and that is all the differentiation we really need. Therefore I felt that the SessionToken could be made a simple String type alias and we would get all the same value from it.

Checklist:

  • I have verified that this change works in the relevant demo app, or N/A
  • I have added or updated any tests relevant to this change, or N/A
  • I have updated any relevant README files for this change, or N/A

@nidal-augment nidal-augment marked this pull request as ready for review January 9, 2026 15:29
@nidal-augment nidal-augment requested a review from a team as a code owner January 9, 2026 15:29
if let opaqueCookieValue = storage.cookieValue(cookieName: SessionToken.Kind.opaque.name, date: date()) {
sessionToken = .opaque(opaqueCookieValue)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lingering cleanup on #574

@jhaven-stytch jhaven-stytch enabled auto-merge (squash) February 5, 2026 17:50
@jhaven-stytch jhaven-stytch merged commit c229630 into stytchauth:main Feb 5, 2026
9 of 13 checks passed
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.

2 participants