Skip to content

Commit 1ecc4c8

Browse files
authored
feat: Add header based session management logic (#81)
* feat: Add logic to allow using headers instead of cookies (#74) * Make changes for fetch * Make changes for axios * Changes to test * Changes to test * Changes to test * Fix config tests * Fix config tests * Refactor * Fix fetch tests * Fix general error tests * Update axios tests * Update axios tests * Fic for axios * Fic for axios * Fixes * Fix header logic * Add axios 2 header tests * Fix issue with axios * Fix issue with axios * Fix issue with axios * Fix issue with axios * Add header tests for fetch * Add header checks for config tests * Make header the default mechanism * Update tests * Update based on PR review * Update tests * Add function to get access token * Add tests to make sure older sessions still work * Refactor * Refactor * Refactor * Refactor * Add axios tests * chore: Modify header based auth logic based on reviews (#79) * Add function to get access token * Add tests to make sure older sessions still work * Refactor * Refactor * Refactor * Refactor * Add axios tests * Add additional tests for fetch * Add additional tests for axios * Add tests * Export getAccessToken as a default export * Handle cookie strings for legacy sessions when reading tokens from storage * Add test for moving from old cookies to header * Update FDI, CHANGELOG and package versio * Refactor
1 parent a18585f commit 1ecc4c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+6332
-1369
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [unreleased]
88

9+
## [4.0.0] - 2023-01-30
10+
11+
### Breaking Changes
12+
13+
- The SDK now only supports FDI version 1.16
14+
- The backend SDK should be updated to a version supporting the header-based sessions!
15+
- supertokens-node: >= 13.0.0
16+
- supertokens-python: >= 0.12.0
17+
- supertokens-golang: >= 0.10.0
18+
- Properties passed when calling SuperTokens.init have been renamed:
19+
- `cookieDomain` -> `sessionTokenBackendDomain`
20+
21+
### Added
22+
23+
- The SDK now supports managing sessions via headers (using `Authorization` bearer tokens) instead of cookies
24+
- A new property has been added when calling SuperTokens.init: `tokenTransferMethod`. This can be used to configure whether the SDK should use cookies or headers for session management (`header` by default). Refer to https://supertokens.com/docs/thirdpartyemailpassword/common-customizations/sessions/token-transfer-method for more information
25+
926
## [3.2.0] - 2022-09-17
1027

1128
### Changes

0 commit comments

Comments
 (0)