You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+296-1Lines changed: 296 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,304 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
8
8
## [unreleased]
9
9
10
-
## [0.12.0] - 2023-05-03
10
+
## [0.12.0] - 2023-05-05
11
+
12
+
### Added
13
+
11
14
- added optional password policy check in `updateEmailOrPassword`
12
15
16
+
### Breaking Changes
17
+
18
+
- Changed the interface and configuration of the Session recipe, see below for details. If you do not use the Session recipe directly and do not provide custom configuration, then no migration is necessary.
19
+
- Renamed `GetSessionData` to `GetSessionDataInDatabase` to clarify that it always hits the DB
20
+
- Renamed `GetSessionDataWithContext` to `GetSessionDataInDatabaseWithContext` to clarify that it always hits the DB
21
+
- Renamed `UpdateSessionData` to `UpdateSessionDataInDatabase`
22
+
- Renamed `UpdateSessionDataWithContext` to `UpdateSessionDataInDatabaseWithContext` to clarify that it always hits the DB
23
+
- Renamed `SessionData` to `SessionDataInDatabase` in `SessionInformation`
24
+
- Renamed `sessionData` to `sessionDataInDatabase` in the input to `CreateNewSession`
25
+
- Added `useStaticSigningKey` to `CreateJWT` and `CreateJWTWithContext`
26
+
- Added support for CDI version `2.21`
27
+
- Dropped support for CDI version `2.8`-`2.20`
28
+
-`GetAccessTokenPayload` will now return standard (`sub`, `iat`, `exp`) claims and some SuperTokens specific claims along the user defined ones in `GetAccessTokenPayload`.
29
+
- Some claim names are now prohibited in the root level of the access token payload
30
+
- They are: `sub`, `iat`, `exp`, `sessionHandle`, `parentRefreshTokenHash1`, `refreshTokenHash1`, `antiCsrfToken`
31
+
- If you used these in the root level of the access token payload, then you'll need to migrate your sessions or they will be logged out during the next refresh
32
+
- These props should be renamed (e.g., by adding a prefix) or moved inside an object in the access token payload
33
+
- You can migrate these sessions by updating their payload to match your new structure, by calling `MergeIntoAccessTokenPayload`
34
+
- New access tokens are valid JWTs now
35
+
- They can be used directly (i.e.: by calling `GetAccessToken` on the session) if you need a JWT
36
+
- The `jwt` prop in the access token payload is removed
37
+
- JWT and OpenId related configuration has been removed from the Session recipe config. If necessary, they can be added by initializing the OpenId recipe before the Session recipe.
38
+
- Changed the Session recipe interface - CreateNewSession, GetSession and RefreshSession overrides now do not take response and request and return status instead of throwing
39
+
- Renamed `AccessTokenPayload` to `CustomClaimsInAccessTokenPayload` in `SessionInformation` (the return value of `GetSessionInformation`). This reflects the fact that it doesn't contain some default claims (`sub`, `iat`, etc.)
40
+
41
+
### Changed
42
+
43
+
- Refactors the URL for the JWKS endpoint exposed by SuperTokens core
44
+
- Added new optional `useStaticSigningKey` param to `CreateJWT`
45
+
- The Session recipe now always initializes the OpenID recipe if it hasn't been initialized.
46
+
- Refactored how access token validation is done
47
+
- Added support for new access token version
48
+
- Removed the handshake call to improve start-up times
49
+
- Removed `GetAccessTokenLifeTimeMS` and `GetRefreshTokenLifeTimeMS` functions
50
+
- Added `ExposeAccessTokenToFrontendInCookieBasedAuth` (defaults to `false`) option to the Session recipe config
51
+
- Added new `checkDatabase` param to `VerifySession` and `GetSession`
52
+
- Removed deprecated `UpdateAccessTokenPayload`, `UpdateAccessTokenPayloadWithContext`, `RegenerateAccessToken` and `RegenerateAccessTokenWithContext` from the Session recipe interface
53
+
- Added `CreateNewSessionWithoutRequestResponse`, `CreateNewSessionWithContextWithoutRequestResponse`, `GetSessionWithoutRequestResponse`, `GetSessionWithContextWithoutRequestResponse`, `RefreshSession`, `RefreshSessionWithContextWithoutRequestResponse` to the Session recipe.
54
+
- Added `GetAllSessionTokensDangerously` to session objects (`SessionContainer`)
55
+
- Added `AttachToRequestResponse` to session objects (`SessionContainer`)
56
+
57
+
### Migration
58
+
59
+
#### If self-hosting core
60
+
61
+
1. You need to update the core version
62
+
2. There are manual migration steps needed. Check out the core changelogs for more details.
63
+
64
+
#### If you used the jwt feature of the session recipe
65
+
66
+
1. Add `ExposeAccessTokenToFrontendInCookieBasedAuth: true` to the Session recipe config on the backend if you need to access the JWT on the frontend.
67
+
2. On the frontend where you accessed the JWT before by: `(await Session.getAccessTokenPayloadSecurely()).jwt` update to:
// This branch is only required if there are valid access tokens created before the update
90
+
// It can be removed after the validity period ends
91
+
jwt = accessTokenPayload["jwt"].(string);
92
+
}
93
+
```
94
+
95
+
#### If you used to set an issuer in the session recipe `Jwt` configuration
96
+
97
+
- You can add an issuer claim to access tokens by overriding the `CreateNewSession` function in the session recipe init.
98
+
- Check out https://supertokens.com/docs/passwordless/common-customizations/sessions/claims/access-token-payload#during-session-creation for more information
99
+
- You can add an issuer claim to JWTs created by the JWT recipe by passing the `iss` claim as part of the payload.
100
+
- You can set the OpenId discovery configuration as follows:
0 commit comments