@frontegg/redux-store 6.77.0-alpha.6 → 6.77.0-alpha.7
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/ForgotPasswordState/index.d.ts +6 -7
- package/auth/ForgotPasswordState/interfaces.d.ts +8 -0
- package/auth/ForgotPasswordState/saga.js +5 -1
- package/auth/LoginState/index.d.ts +4 -4
- package/auth/LoginState/interfaces.d.ts +4 -1
- package/auth/LoginState/saga.js +12 -7
- package/auth/index.d.ts +3 -3
- package/auth/reducer.d.ts +3 -3
- package/index.js +1 -1
- package/node/auth/ForgotPasswordState/saga.js +5 -1
- package/node/auth/LoginState/saga.js +12 -7
- package/node/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ForgotPasswordState } from './interfaces';
|
|
3
|
-
import { WithCallback } from '../../interfaces';
|
|
1
|
+
import { IGetUserPasswordConfig } from '@frontegg/rest-api';
|
|
2
|
+
import { ForgotPasswordState, IForgotPasswordPayload, IResetPasswordPayload } from './interfaces';
|
|
4
3
|
declare const forgotPasswordState: ForgotPasswordState;
|
|
5
4
|
declare const reducers: {
|
|
6
5
|
setForgotPasswordState: {
|
|
@@ -95,8 +94,8 @@ declare const reducers: {
|
|
|
95
94
|
};
|
|
96
95
|
};
|
|
97
96
|
declare const actions: {
|
|
98
|
-
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
99
|
-
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
97
|
+
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IForgotPasswordPayload], IForgotPasswordPayload, string, never, never>;
|
|
98
|
+
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IResetPasswordPayload], IResetPasswordPayload, string, never, never>;
|
|
100
99
|
loadPasswordConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(IGetUserPasswordConfig | undefined)?], IGetUserPasswordConfig | undefined, string, never, never>;
|
|
101
100
|
};
|
|
102
101
|
/**
|
|
@@ -106,8 +105,8 @@ declare const actions: {
|
|
|
106
105
|
declare type DispatchedActions = {
|
|
107
106
|
setForgotPasswordState: (state: Partial<ForgotPasswordState>) => void;
|
|
108
107
|
resetForgotPasswordState: () => void;
|
|
109
|
-
forgotPassword: (payload:
|
|
110
|
-
resetPassword: (payload:
|
|
108
|
+
forgotPassword: (payload: IForgotPasswordPayload) => void;
|
|
109
|
+
resetPassword: (payload: IResetPasswordPayload) => void;
|
|
111
110
|
loadPasswordConfig: (payload?: IGetUserPasswordConfig) => void;
|
|
112
111
|
};
|
|
113
112
|
export declare type ForgotPasswordActions = DispatchedActions;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IForgotPassword, IResetPassword } from '@frontegg/rest-api';
|
|
2
|
+
import { WithCallback } from '../../interfaces';
|
|
1
3
|
export declare enum ForgotPasswordStep {
|
|
2
4
|
'forgotPassword' = "forgotPassword",
|
|
3
5
|
'success' = "success"
|
|
@@ -16,3 +18,9 @@ export interface ForgotPasswordState {
|
|
|
16
18
|
loading: boolean;
|
|
17
19
|
error?: any;
|
|
18
20
|
}
|
|
21
|
+
export interface IForgotPasswordPayload extends WithCallback<IForgotPassword> {
|
|
22
|
+
recaptchaToken?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IResetPasswordPayload extends WithCallback<IResetPassword> {
|
|
25
|
+
recaptchaToken?: string;
|
|
26
|
+
}
|
|
@@ -11,17 +11,21 @@ function* forgotPassword({
|
|
|
11
11
|
loading: true
|
|
12
12
|
}));
|
|
13
13
|
try {
|
|
14
|
+
var _payload$callback;
|
|
14
15
|
yield call(api.auth.forgotPassword, payload);
|
|
15
16
|
yield put(actions.setForgotPasswordState({
|
|
16
17
|
loading: false,
|
|
17
18
|
error: undefined,
|
|
18
19
|
step: ForgotPasswordStep.success
|
|
19
20
|
}));
|
|
21
|
+
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
20
22
|
} catch (e) {
|
|
23
|
+
var _payload$callback2;
|
|
21
24
|
yield put(actions.setForgotPasswordState({
|
|
22
25
|
loading: false,
|
|
23
26
|
error: e.message || 'Unknown error occurred'
|
|
24
27
|
}));
|
|
28
|
+
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
function* resetPassword(_ref) {
|
|
@@ -47,7 +51,7 @@ function* resetPassword(_ref) {
|
|
|
47
51
|
loading: false,
|
|
48
52
|
error: e.message
|
|
49
53
|
}));
|
|
50
|
-
callback == null ? void 0 : callback(false);
|
|
54
|
+
callback == null ? void 0 : callback(false, e);
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
export function* loadPasswordConfig({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IChangePhoneNumberWithVerification, ICreateNewDeviceSessionResponse, IEmailPasswordlessPreLogin, IEnrollMFAAuthenticatorApp, IEnrollMFASMS, ILogin, ILoginWithMfa, IPostLogin, IPreEnrollMFA, IPreEnrollMFASMS, IPreLogin, IPreVerifyMFA,
|
|
2
|
-
import { FronteggNextJSSession, HostedLoginCallback, IEnrollMFAWebAuthnPayload, IPasswordlessPostLoginPayload, IPreEnrollMFAWebAuthNForLoginResponse, IPreVerifyMFAWebAuthNForLoginResponse, IQuickSmsPasswordlessPreLoginPayload, IVerifyMFAWebAuthnPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginState, WithDeviceId } from './interfaces';
|
|
1
|
+
import { IChangePhoneNumberWithVerification, ICreateNewDeviceSessionResponse, IEmailPasswordlessPreLogin, IEnrollMFAAuthenticatorApp, IEnrollMFASMS, ILogin, ILoginWithMfa, IPostLogin, IPreEnrollMFA, IPreEnrollMFASMS, IPreLogin, IPreVerifyMFA, IVerifyChangePhoneNumber, IVerifyMFASMS, IWebAuthnPreLogin, IWebAuthnPreLoginResponse } from '@frontegg/rest-api';
|
|
2
|
+
import { FronteggNextJSSession, HostedLoginCallback, IEnrollMFAWebAuthnPayload, IPasswordlessPostLoginPayload, IPreEnrollMFAWebAuthNForLoginResponse, IPreVerifyMFAWebAuthNForLoginResponse, IQuickSmsPasswordlessPreLoginPayload, IRecoverMFATokenPayload, IVerifyMFAWebAuthnPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginState, WithDeviceId } from './interfaces';
|
|
3
3
|
import { WithCallback } from '../../interfaces';
|
|
4
4
|
import { IVerifyInviteToken } from '@frontegg/rest-api';
|
|
5
5
|
declare const loginState: LoginState;
|
|
@@ -111,7 +111,7 @@ declare const actions: {
|
|
|
111
111
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IPostLogin], IPostLogin, string, never, never>;
|
|
112
112
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ILogin, boolean>], WithCallback<ILogin, boolean>, string, never, never>;
|
|
113
113
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[WithCallback<ILoginWithMfa, boolean>], WithCallback<ILoginWithMfa, boolean>, string, never, never>;
|
|
114
|
-
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[
|
|
114
|
+
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[IRecoverMFATokenPayload], IRecoverMFATokenPayload, string, never, never>;
|
|
115
115
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
116
116
|
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(WithCallback<{
|
|
117
117
|
callbackTimeout?: number | undefined;
|
|
@@ -171,7 +171,7 @@ declare type DispatchedActions = {
|
|
|
171
171
|
postLogin: (payload: IPostLogin) => void;
|
|
172
172
|
login: (payload: WithCallback<ILogin>) => void;
|
|
173
173
|
loginWithMfa: (payload: WithCallback<ILoginWithMfa>) => void;
|
|
174
|
-
recoverMfa: (payload:
|
|
174
|
+
recoverMfa: (payload: IRecoverMFATokenPayload) => void;
|
|
175
175
|
logout: (payload?: () => void) => void;
|
|
176
176
|
silentLogout: (payload?: WithCallback<{
|
|
177
177
|
callbackTimeout?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthStrategyEnum, IEnrollMFAWebAuthn, ILoginResponse, IPasswordlessPostLogin, ITenantsResponse, IVerifyMFAWebAuthn, IVerifyNewWebAuthnDevice, IWebAuthnPostLogin } from '@frontegg/rest-api';
|
|
1
|
+
import { AuthStrategyEnum, IEnrollMFAWebAuthn, ILoginResponse, IPasswordlessPostLogin, IRecoverMFAToken, ITenantsResponse, IVerifyMFAWebAuthn, IVerifyNewWebAuthnDevice, IWebAuthnPostLogin } from '@frontegg/rest-api';
|
|
2
2
|
import { WithCallback } from '../../interfaces';
|
|
3
3
|
import { CustomEventsOptions } from '../interfaces';
|
|
4
4
|
export declare enum LoginStep {
|
|
@@ -88,3 +88,6 @@ export declare type IEnrollMFAWebAuthnPayload = WithCallback<Omit<IEnrollMFAWebA
|
|
|
88
88
|
export declare type IVerifyMFAWebAuthnPayload = WithCallback<WithDeviceId<Omit<IVerifyMFAWebAuthn, 'options'>>> & {
|
|
89
89
|
publicKey: Credential;
|
|
90
90
|
};
|
|
91
|
+
export interface IRecoverMFATokenPayload extends WithCallback<IRecoverMFAToken> {
|
|
92
|
+
recaptchaToken?: string;
|
|
93
|
+
}
|
package/auth/LoginState/saga.js
CHANGED
|
@@ -927,14 +927,15 @@ function* preLogin({
|
|
|
927
927
|
onRedirectTo
|
|
928
928
|
}
|
|
929
929
|
}) => onRedirectTo);
|
|
930
|
-
|
|
930
|
+
const {
|
|
931
931
|
address,
|
|
932
932
|
idpType
|
|
933
933
|
} = yield call(api.auth.preLoginV2, {
|
|
934
934
|
email
|
|
935
935
|
});
|
|
936
936
|
if (address) {
|
|
937
|
-
|
|
937
|
+
let ssoRedirectUrl = address;
|
|
938
|
+
if (idpType === SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
|
|
938
939
|
const {
|
|
939
940
|
routes: {
|
|
940
941
|
oidcRedirectUrl
|
|
@@ -946,15 +947,15 @@ function* preLogin({
|
|
|
946
947
|
}) => ({
|
|
947
948
|
routes
|
|
948
949
|
}));
|
|
949
|
-
|
|
950
|
+
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
950
951
|
}
|
|
951
952
|
yield put(actions.setLoginState({
|
|
952
953
|
step: LoginStep.redirectToSSO,
|
|
953
954
|
loading: false,
|
|
954
|
-
ssoRedirectUrl
|
|
955
|
+
ssoRedirectUrl
|
|
955
956
|
}));
|
|
956
957
|
setTimeout(() => {
|
|
957
|
-
onRedirectTo(
|
|
958
|
+
onRedirectTo(ssoRedirectUrl, {
|
|
958
959
|
refresh: true
|
|
959
960
|
});
|
|
960
961
|
}, 2000);
|
|
@@ -1357,6 +1358,7 @@ function* recoverMfa({
|
|
|
1357
1358
|
loading: true
|
|
1358
1359
|
}));
|
|
1359
1360
|
try {
|
|
1361
|
+
var _payload$callback;
|
|
1360
1362
|
yield call(api.auth.recoverMfaToken, payload);
|
|
1361
1363
|
yield put(actions.setLoginState({
|
|
1362
1364
|
loading: false,
|
|
@@ -1367,11 +1369,14 @@ function* recoverMfa({
|
|
|
1367
1369
|
user: undefined,
|
|
1368
1370
|
isAuthenticated: false
|
|
1369
1371
|
}));
|
|
1372
|
+
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
1370
1373
|
} catch (e) {
|
|
1374
|
+
var _payload$callback2;
|
|
1371
1375
|
yield put(actions.setLoginState({
|
|
1372
1376
|
error: e.message,
|
|
1373
1377
|
loading: false
|
|
1374
1378
|
}));
|
|
1379
|
+
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
|
|
1375
1380
|
}
|
|
1376
1381
|
}
|
|
1377
1382
|
function* logout({
|
|
@@ -1402,8 +1407,8 @@ function* silentLogout({
|
|
|
1402
1407
|
yield call(api.auth.logout);
|
|
1403
1408
|
} catch {}
|
|
1404
1409
|
setTimeout(() => {
|
|
1405
|
-
var _payload$
|
|
1406
|
-
return payload == null ? void 0 : (_payload$
|
|
1410
|
+
var _payload$callback3;
|
|
1411
|
+
return payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
1407
1412
|
}, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
|
|
1408
1413
|
}
|
|
1409
1414
|
function* handleEnrollMFAResponse({
|
package/auth/index.d.ts
CHANGED
|
@@ -394,8 +394,8 @@ declare const _default: {
|
|
|
394
394
|
recaptchaToken?: string | undefined;
|
|
395
395
|
email: string;
|
|
396
396
|
}, boolean>, string, never, never>;
|
|
397
|
-
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
398
|
-
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
397
|
+
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./ForgotPasswordState/interfaces").IForgotPasswordPayload], import("./ForgotPasswordState/interfaces").IForgotPasswordPayload, string, never, never>;
|
|
398
|
+
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./ForgotPasswordState/interfaces").IResetPasswordPayload], import("./ForgotPasswordState/interfaces").IResetPasswordPayload, string, never, never>;
|
|
399
399
|
loadPasswordConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("@frontegg/rest-api").IGetUserPasswordConfig | undefined)?], import("@frontegg/rest-api").IGetUserPasswordConfig | undefined, string, never, never>;
|
|
400
400
|
acceptInvitation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IAcceptInvitation], import("@frontegg/rest-api").IAcceptInvitation, string, never, never>;
|
|
401
401
|
activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("./ActivateState/interfaces").IActivateAccountPayload, boolean>], import("..").WithCallback<import("./ActivateState/interfaces").IActivateAccountPayload, boolean>, string, never, never>;
|
|
@@ -421,7 +421,7 @@ declare const _default: {
|
|
|
421
421
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
|
|
422
422
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ILogin, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ILogin, boolean>, string, never, never>;
|
|
423
423
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
|
|
424
|
-
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
424
|
+
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./LoginState/interfaces").IRecoverMFATokenPayload], import("./LoginState/interfaces").IRecoverMFATokenPayload, string, never, never>;
|
|
425
425
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
426
426
|
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithCallback<{
|
|
427
427
|
callbackTimeout?: number | undefined;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -359,8 +359,8 @@ declare const actions: {
|
|
|
359
359
|
recaptchaToken?: string | undefined;
|
|
360
360
|
email: string;
|
|
361
361
|
}, boolean>, string, never, never>;
|
|
362
|
-
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
363
|
-
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
362
|
+
forgotPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").IForgotPasswordPayload], import(".").IForgotPasswordPayload, string, never, never>;
|
|
363
|
+
resetPassword: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").IResetPasswordPayload], import(".").IResetPasswordPayload, string, never, never>;
|
|
364
364
|
loadPasswordConfig: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("@frontegg/rest-api").IGetUserPasswordConfig | undefined)?], import("@frontegg/rest-api").IGetUserPasswordConfig | undefined, string, never, never>;
|
|
365
365
|
acceptInvitation: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IAcceptInvitation], import("@frontegg/rest-api").IAcceptInvitation, string, never, never>;
|
|
366
366
|
activateAccount: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import(".").IActivateAccountPayload, boolean>], import("..").WithCallback<import(".").IActivateAccountPayload, boolean>, string, never, never>;
|
|
@@ -386,7 +386,7 @@ declare const actions: {
|
|
|
386
386
|
postLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").IPostLogin], import("@frontegg/rest-api").IPostLogin, string, never, never>;
|
|
387
387
|
login: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ILogin, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ILogin, boolean>, string, never, never>;
|
|
388
388
|
loginWithMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>], import("..").WithCallback<import("@frontegg/rest-api").ILoginWithMfa, boolean>, string, never, never>;
|
|
389
|
-
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("
|
|
389
|
+
recoverMfa: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").IRecoverMFATokenPayload], import(".").IRecoverMFATokenPayload, string, never, never>;
|
|
390
390
|
logout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[((() => void) | undefined)?], (() => void) | undefined, string, never, never>;
|
|
391
391
|
silentLogout: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(import("..").WithCallback<{
|
|
392
392
|
callbackTimeout?: number | undefined;
|
package/index.js
CHANGED
|
@@ -19,17 +19,21 @@ function* forgotPassword({
|
|
|
19
19
|
loading: true
|
|
20
20
|
}));
|
|
21
21
|
try {
|
|
22
|
+
var _payload$callback;
|
|
22
23
|
yield (0, _effects.call)(_restApi.api.auth.forgotPassword, payload);
|
|
23
24
|
yield (0, _effects.put)(_reducer.actions.setForgotPasswordState({
|
|
24
25
|
loading: false,
|
|
25
26
|
error: undefined,
|
|
26
27
|
step: _interfaces.ForgotPasswordStep.success
|
|
27
28
|
}));
|
|
29
|
+
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
28
30
|
} catch (e) {
|
|
31
|
+
var _payload$callback2;
|
|
29
32
|
yield (0, _effects.put)(_reducer.actions.setForgotPasswordState({
|
|
30
33
|
loading: false,
|
|
31
34
|
error: e.message || 'Unknown error occurred'
|
|
32
35
|
}));
|
|
36
|
+
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
39
|
function* resetPassword(_ref) {
|
|
@@ -55,7 +59,7 @@ function* resetPassword(_ref) {
|
|
|
55
59
|
loading: false,
|
|
56
60
|
error: e.message
|
|
57
61
|
}));
|
|
58
|
-
callback == null ? void 0 : callback(false);
|
|
62
|
+
callback == null ? void 0 : callback(false, e);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
function* loadPasswordConfig({
|
|
@@ -944,14 +944,15 @@ function* preLogin({
|
|
|
944
944
|
onRedirectTo
|
|
945
945
|
}
|
|
946
946
|
}) => onRedirectTo);
|
|
947
|
-
|
|
947
|
+
const {
|
|
948
948
|
address,
|
|
949
949
|
idpType
|
|
950
950
|
} = yield (0, _effects.call)(_restApi.api.auth.preLoginV2, {
|
|
951
951
|
email
|
|
952
952
|
});
|
|
953
953
|
if (address) {
|
|
954
|
-
|
|
954
|
+
let ssoRedirectUrl = address;
|
|
955
|
+
if (idpType === _interfaces4.SamlVendors.Oidc && !ssoRedirectUrl.includes('redirect_uri')) {
|
|
955
956
|
const {
|
|
956
957
|
routes: {
|
|
957
958
|
oidcRedirectUrl
|
|
@@ -963,15 +964,15 @@ function* preLogin({
|
|
|
963
964
|
}) => ({
|
|
964
965
|
routes
|
|
965
966
|
}));
|
|
966
|
-
|
|
967
|
+
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
967
968
|
}
|
|
968
969
|
yield (0, _effects.put)(_reducer.actions.setLoginState({
|
|
969
970
|
step: _interfaces2.LoginStep.redirectToSSO,
|
|
970
971
|
loading: false,
|
|
971
|
-
ssoRedirectUrl
|
|
972
|
+
ssoRedirectUrl
|
|
972
973
|
}));
|
|
973
974
|
setTimeout(() => {
|
|
974
|
-
onRedirectTo(
|
|
975
|
+
onRedirectTo(ssoRedirectUrl, {
|
|
975
976
|
refresh: true
|
|
976
977
|
});
|
|
977
978
|
}, 2000);
|
|
@@ -1374,6 +1375,7 @@ function* recoverMfa({
|
|
|
1374
1375
|
loading: true
|
|
1375
1376
|
}));
|
|
1376
1377
|
try {
|
|
1378
|
+
var _payload$callback;
|
|
1377
1379
|
yield (0, _effects.call)(_restApi.api.auth.recoverMfaToken, payload);
|
|
1378
1380
|
yield (0, _effects.put)(_reducer.actions.setLoginState({
|
|
1379
1381
|
loading: false,
|
|
@@ -1384,11 +1386,14 @@ function* recoverMfa({
|
|
|
1384
1386
|
user: undefined,
|
|
1385
1387
|
isAuthenticated: false
|
|
1386
1388
|
}));
|
|
1389
|
+
(_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, true);
|
|
1387
1390
|
} catch (e) {
|
|
1391
|
+
var _payload$callback2;
|
|
1388
1392
|
yield (0, _effects.put)(_reducer.actions.setLoginState({
|
|
1389
1393
|
error: e.message,
|
|
1390
1394
|
loading: false
|
|
1391
1395
|
}));
|
|
1396
|
+
(_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, false, e);
|
|
1392
1397
|
}
|
|
1393
1398
|
}
|
|
1394
1399
|
function* logout({
|
|
@@ -1419,8 +1424,8 @@ function* silentLogout({
|
|
|
1419
1424
|
yield (0, _effects.call)(_restApi.api.auth.logout);
|
|
1420
1425
|
} catch {}
|
|
1421
1426
|
setTimeout(() => {
|
|
1422
|
-
var _payload$
|
|
1423
|
-
return payload == null ? void 0 : (_payload$
|
|
1427
|
+
var _payload$callback3;
|
|
1428
|
+
return payload == null ? void 0 : (_payload$callback3 = payload.callback) == null ? void 0 : _payload$callback3.call(payload, true);
|
|
1424
1429
|
}, (_payload$callbackTime = payload == null ? void 0 : payload.callbackTimeout) != null ? _payload$callbackTime : 500);
|
|
1425
1430
|
}
|
|
1426
1431
|
function* handleEnrollMFAResponse({
|
package/node/index.js
CHANGED