@frontegg/redux-store 6.41.0 → 6.42.0
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/auth/LoginState/index.d.ts +3 -3
- package/auth/LoginState/interfaces.d.ts +4 -0
- package/auth/LoginState/saga.js +9 -4
- package/auth/index.d.ts +1 -1
- package/auth/interfaces.d.ts +1 -1
- package/auth/reducer.d.ts +1 -1
- package/index.js +1 -1
- package/node/auth/LoginState/saga.js +9 -4
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IChangePhoneNumberWithVerification, ICreateNewDeviceSessionResponse, IEmailPasswordlessPreLogin, ILogin, ILoginWithMfa, IPostLogin, IPreLogin, IRecoverMFAToken, IVerifyChangePhoneNumber, IWebAuthnPreLogin, IWebAuthnPreLoginResponse } from '@frontegg/rest-api';
|
|
2
|
-
import { HostedLoginCallback, IPasswordlessPostLoginPayload, IQuickSmsPasswordlessPreLoginPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginState } from './interfaces';
|
|
2
|
+
import { FronteggNextJSSession, HostedLoginCallback, IPasswordlessPostLoginPayload, IQuickSmsPasswordlessPreLoginPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginState } from './interfaces';
|
|
3
3
|
import { WithCallback } from '../../interfaces';
|
|
4
4
|
import { IVerifyInviteToken } from '@frontegg/rest-api';
|
|
5
5
|
declare const loginState: LoginState;
|
|
@@ -85,7 +85,7 @@ declare const reducers: {
|
|
|
85
85
|
};
|
|
86
86
|
declare const actions: {
|
|
87
87
|
requestAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(boolean | undefined)?], boolean, string, never, never>;
|
|
88
|
-
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
88
|
+
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[FronteggNextJSSession], FronteggNextJSSession, string, never, never>;
|
|
89
89
|
requestHostedLoginAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(Record<string, string> | undefined)?], Record<string, string> | undefined, string, never, never>;
|
|
90
90
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[HostedLoginCallback], HostedLoginCallback, string, never, never>;
|
|
91
91
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
@@ -139,7 +139,7 @@ declare type DispatchedActions = {
|
|
|
139
139
|
setLoginState: (state: Partial<LoginState>) => void;
|
|
140
140
|
resetLoginState: () => void;
|
|
141
141
|
requestAuthorize: (payload?: boolean) => void;
|
|
142
|
-
requestAuthorizeSSR: (payload:
|
|
142
|
+
requestAuthorizeSSR: (payload: FronteggNextJSSession) => void;
|
|
143
143
|
requestHostedLoginAuthorize: (payload?: Record<string, string>) => void;
|
|
144
144
|
handleHostedLoginCallback: (payload: HostedLoginCallback) => void;
|
|
145
145
|
afterAuthNavigation: () => void;
|
|
@@ -50,6 +50,10 @@ export interface HostedLoginCallback {
|
|
|
50
50
|
state?: string;
|
|
51
51
|
nonce?: string;
|
|
52
52
|
}
|
|
53
|
+
export interface FronteggNextJSSession {
|
|
54
|
+
accessToken: string;
|
|
55
|
+
refreshToken?: string;
|
|
56
|
+
}
|
|
53
57
|
export interface IQuickSmsPasswordlessPreLoginPayload {
|
|
54
58
|
userId: string;
|
|
55
59
|
recaptchaToken?: string;
|
package/auth/LoginState/saga.js
CHANGED
|
@@ -321,7 +321,10 @@ function* requestAuthorize({
|
|
|
321
321
|
}));
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
function* refreshTokenSSR(
|
|
324
|
+
function* refreshTokenSSR({
|
|
325
|
+
accessToken,
|
|
326
|
+
refreshToken
|
|
327
|
+
}) {
|
|
325
328
|
if (!accessToken) {
|
|
326
329
|
ContextHolder.setAccessToken(null);
|
|
327
330
|
ContextHolder.setUser(null);
|
|
@@ -356,7 +359,9 @@ function* refreshTokenSSR(accessToken) {
|
|
|
356
359
|
loading: false
|
|
357
360
|
}));
|
|
358
361
|
yield put(actions.setState({
|
|
359
|
-
user,
|
|
362
|
+
user: _extends({}, user, {
|
|
363
|
+
refreshToken
|
|
364
|
+
}),
|
|
360
365
|
isAuthenticated: true
|
|
361
366
|
}));
|
|
362
367
|
}
|
|
@@ -371,7 +376,7 @@ function* refreshTokenSSR(accessToken) {
|
|
|
371
376
|
}
|
|
372
377
|
|
|
373
378
|
function* requestAuthorizeSSR({
|
|
374
|
-
payload
|
|
379
|
+
payload
|
|
375
380
|
}) {
|
|
376
381
|
const calls = [];
|
|
377
382
|
yield put(actions.setState({
|
|
@@ -382,7 +387,7 @@ function* requestAuthorizeSSR({
|
|
|
382
387
|
calls.push(call(loadSSOPublicConfigurationFunction));
|
|
383
388
|
calls.push(call(loadVendorPublicInfo));
|
|
384
389
|
calls.push(call(refreshMetadata));
|
|
385
|
-
calls.push(call(refreshTokenSSR,
|
|
390
|
+
calls.push(call(refreshTokenSSR, payload));
|
|
386
391
|
yield all(calls);
|
|
387
392
|
yield put(actions.setState({
|
|
388
393
|
isLoading: false
|
package/auth/index.d.ts
CHANGED
|
@@ -321,7 +321,7 @@ declare const _default: {
|
|
|
321
321
|
loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload], import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload, string, never, never>;
|
|
322
322
|
setSocialLoginError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ISetSocialLoginError], import("@frontegg/rest-api").ISetSocialLoginError, string, never, never>;
|
|
323
323
|
requestAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(boolean | undefined)?], boolean, string, never, never>;
|
|
324
|
-
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
324
|
+
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./LoginState/interfaces").FronteggNextJSSession], import("./LoginState/interfaces").FronteggNextJSSession, string, never, never>;
|
|
325
325
|
requestHostedLoginAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(Record<string, string> | undefined)?], Record<string, string> | undefined, string, never, never>;
|
|
326
326
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./LoginState/interfaces").HostedLoginCallback], import("./LoginState/interfaces").HostedLoginCallback, string, never, never>;
|
|
327
327
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { SessionsPolicyState } from './SessionsPolicyState/interfaces';
|
|
|
20
20
|
import { RestrictionsState } from './RestrictionsState/interfaces';
|
|
21
21
|
export interface User extends IUserProfile {
|
|
22
22
|
accessToken: string;
|
|
23
|
-
refreshToken
|
|
23
|
+
refreshToken?: string;
|
|
24
24
|
expiresIn: number;
|
|
25
25
|
expires: string;
|
|
26
26
|
sid?: string;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -290,7 +290,7 @@ declare const actions: {
|
|
|
290
290
|
loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").ILoginViaSocialLoginPayload], import(".").ILoginViaSocialLoginPayload, string, never, never>;
|
|
291
291
|
setSocialLoginError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ISetSocialLoginError], import("@frontegg/rest-api").ISetSocialLoginError, string, never, never>;
|
|
292
292
|
requestAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(boolean | undefined)?], boolean, string, never, never>;
|
|
293
|
-
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
293
|
+
requestAuthorizeSSR: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").FronteggNextJSSession], import(".").FronteggNextJSSession, string, never, never>;
|
|
294
294
|
requestHostedLoginAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(Record<string, string> | undefined)?], Record<string, string> | undefined, string, never, never>;
|
|
295
295
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").HostedLoginCallback], import(".").HostedLoginCallback, string, never, never>;
|
|
296
296
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/index.js
CHANGED
|
@@ -372,7 +372,10 @@ function* requestAuthorize({
|
|
|
372
372
|
}));
|
|
373
373
|
}
|
|
374
374
|
|
|
375
|
-
function* refreshTokenSSR(
|
|
375
|
+
function* refreshTokenSSR({
|
|
376
|
+
accessToken,
|
|
377
|
+
refreshToken
|
|
378
|
+
}) {
|
|
376
379
|
if (!accessToken) {
|
|
377
380
|
_restApi.ContextHolder.setAccessToken(null);
|
|
378
381
|
|
|
@@ -409,7 +412,9 @@ function* refreshTokenSSR(accessToken) {
|
|
|
409
412
|
loading: false
|
|
410
413
|
}));
|
|
411
414
|
yield (0, _effects.put)(_reducer.actions.setState({
|
|
412
|
-
user,
|
|
415
|
+
user: (0, _extends2.default)({}, user, {
|
|
416
|
+
refreshToken
|
|
417
|
+
}),
|
|
413
418
|
isAuthenticated: true
|
|
414
419
|
}));
|
|
415
420
|
}
|
|
@@ -426,7 +431,7 @@ function* refreshTokenSSR(accessToken) {
|
|
|
426
431
|
}
|
|
427
432
|
|
|
428
433
|
function* requestAuthorizeSSR({
|
|
429
|
-
payload
|
|
434
|
+
payload
|
|
430
435
|
}) {
|
|
431
436
|
const calls = [];
|
|
432
437
|
yield (0, _effects.put)(_reducer.actions.setState({
|
|
@@ -437,7 +442,7 @@ function* requestAuthorizeSSR({
|
|
|
437
442
|
calls.push((0, _effects.call)(loadSSOPublicConfigurationFunction));
|
|
438
443
|
calls.push((0, _effects.call)(_saga2.loadVendorPublicInfo));
|
|
439
444
|
calls.push((0, _effects.call)(refreshMetadata));
|
|
440
|
-
calls.push((0, _effects.call)(refreshTokenSSR,
|
|
445
|
+
calls.push((0, _effects.call)(refreshTokenSSR, payload));
|
|
441
446
|
yield (0, _effects.all)(calls);
|
|
442
447
|
yield (0, _effects.put)(_reducer.actions.setState({
|
|
443
448
|
isLoading: false
|
package/node/index.js
CHANGED