@passflow/core 0.34.0 → 0.35.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.mjs +695 -666
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -312,8 +312,15 @@ declare class StorageManager {
|
|
|
312
312
|
* Save tokens to storage with conditional logic based on delivery mode
|
|
313
313
|
* In cookie/BFF mode: ONLY save ID token (not access/refresh tokens)
|
|
314
314
|
* In JSON mode: save all tokens (existing behavior)
|
|
315
|
+
*
|
|
316
|
+
* A token or scope list that `tokens` does not name stays stored, as a refresh answer needs. With
|
|
317
|
+
* `replace` (a new session) and an access token, in JSON mode, it is removed instead, so nothing
|
|
318
|
+
* of the previous session is left beside the new one. Another app's tokens always stay, and so
|
|
319
|
+
* do its scopes when only its session is stored.
|
|
315
320
|
*/
|
|
316
|
-
saveTokens(tokens: Tokens, deliveryMode?: TokenDeliveryMode
|
|
321
|
+
saveTokens(tokens: Tokens, deliveryMode?: TokenDeliveryMode, options?: {
|
|
322
|
+
replace?: boolean;
|
|
323
|
+
}): void;
|
|
317
324
|
getToken(tokenType: TokenType): string | undefined;
|
|
318
325
|
/**
|
|
319
326
|
* Get tokens from storage with conditional logic based on delivery mode
|
|
@@ -4224,7 +4231,7 @@ export declare class AuthService {
|
|
|
4224
4231
|
/**
|
|
4225
4232
|
* Stores an authentication response: token storage, session state, CSRF token. In BFF mode it
|
|
4226
4233
|
* forwards the tokens to the BFF server first. Starts no session: a cookie-mode refresh applies
|
|
4227
|
-
* its answer through here too.
|
|
4234
|
+
* its answer through here too. `replace` marks a new session: see `StorageManager.saveTokens()`.
|
|
4228
4235
|
*/
|
|
4229
4236
|
private applyAuthResponse;
|
|
4230
4237
|
/** A registration that leaves the user signed in: `Register`, then `SignIn` with the same payload. */
|
|
@@ -6847,6 +6854,11 @@ export declare class Passflow {
|
|
|
6847
6854
|
* Manually set tokens (useful after custom authentication flows).
|
|
6848
6855
|
* This will save tokens to storage, update cache, and trigger SignIn event.
|
|
6849
6856
|
*
|
|
6857
|
+
* The tokens replace the stored session: in JSON mode a refresh token, ID token or scope list
|
|
6858
|
+
* that is not passed is removed from storage. Pass every token you want to keep; read the
|
|
6859
|
+
* current ones with `getTokens()`. In cookie and BFF modes only the ID token is stored, and the
|
|
6860
|
+
* stored one stays when none is passed.
|
|
6861
|
+
*
|
|
6850
6862
|
* @param tokensData - Tokens object to set
|
|
6851
6863
|
* @param tokensData.access_token - JWT access token
|
|
6852
6864
|
* @param tokensData.refresh_token - Optional refresh token
|
package/dist/index.d.ts
CHANGED
|
@@ -312,8 +312,15 @@ declare class StorageManager {
|
|
|
312
312
|
* Save tokens to storage with conditional logic based on delivery mode
|
|
313
313
|
* In cookie/BFF mode: ONLY save ID token (not access/refresh tokens)
|
|
314
314
|
* In JSON mode: save all tokens (existing behavior)
|
|
315
|
+
*
|
|
316
|
+
* A token or scope list that `tokens` does not name stays stored, as a refresh answer needs. With
|
|
317
|
+
* `replace` (a new session) and an access token, in JSON mode, it is removed instead, so nothing
|
|
318
|
+
* of the previous session is left beside the new one. Another app's tokens always stay, and so
|
|
319
|
+
* do its scopes when only its session is stored.
|
|
315
320
|
*/
|
|
316
|
-
saveTokens(tokens: Tokens, deliveryMode?: TokenDeliveryMode
|
|
321
|
+
saveTokens(tokens: Tokens, deliveryMode?: TokenDeliveryMode, options?: {
|
|
322
|
+
replace?: boolean;
|
|
323
|
+
}): void;
|
|
317
324
|
getToken(tokenType: TokenType): string | undefined;
|
|
318
325
|
/**
|
|
319
326
|
* Get tokens from storage with conditional logic based on delivery mode
|
|
@@ -4224,7 +4231,7 @@ export declare class AuthService {
|
|
|
4224
4231
|
/**
|
|
4225
4232
|
* Stores an authentication response: token storage, session state, CSRF token. In BFF mode it
|
|
4226
4233
|
* forwards the tokens to the BFF server first. Starts no session: a cookie-mode refresh applies
|
|
4227
|
-
* its answer through here too.
|
|
4234
|
+
* its answer through here too. `replace` marks a new session: see `StorageManager.saveTokens()`.
|
|
4228
4235
|
*/
|
|
4229
4236
|
private applyAuthResponse;
|
|
4230
4237
|
/** A registration that leaves the user signed in: `Register`, then `SignIn` with the same payload. */
|
|
@@ -6847,6 +6854,11 @@ export declare class Passflow {
|
|
|
6847
6854
|
* Manually set tokens (useful after custom authentication flows).
|
|
6848
6855
|
* This will save tokens to storage, update cache, and trigger SignIn event.
|
|
6849
6856
|
*
|
|
6857
|
+
* The tokens replace the stored session: in JSON mode a refresh token, ID token or scope list
|
|
6858
|
+
* that is not passed is removed from storage. Pass every token you want to keep; read the
|
|
6859
|
+
* current ones with `getTokens()`. In cookie and BFF modes only the ID token is stored, and the
|
|
6860
|
+
* stored one stays when none is passed.
|
|
6861
|
+
*
|
|
6850
6862
|
* @param tokensData - Tokens object to set
|
|
6851
6863
|
* @param tokensData.access_token - JWT access token
|
|
6852
6864
|
* @param tokensData.refresh_token - Optional refresh token
|