@frontegg/redux-store 6.159.0 → 6.160.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 +4 -1
- package/auth/LoginState/interfaces.d.ts +10 -0
- package/auth/LoginState/interfaces.js +7 -1
- package/auth/LoginState/saga.js +9 -3
- package/auth/SocialLogins/index.d.ts +7 -2
- package/auth/SocialLogins/index.js +3 -1
- package/auth/SocialLogins/saga.d.ts +5 -3
- package/auth/SocialLogins/saga.js +8 -3
- package/auth/index.d.ts +7 -1
- package/auth/reducer.d.ts +7 -1
- package/index.js +1 -1
- package/node/auth/LoginState/interfaces.js +9 -2
- package/node/auth/LoginState/saga.js +9 -3
- package/node/auth/SocialLogins/index.js +3 -1
- package/node/auth/SocialLogins/saga.js +8 -3
- package/node/index.js +1 -1
- package/node/toolkit/FronteggNativeModule.js +6 -2
- package/package.json +1 -1
- package/toolkit/FronteggNativeModule.d.ts +2 -1
- package/toolkit/FronteggNativeModule.js +6 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IChangePhoneNumberWithVerification, ICreateNewDeviceSessionResponse, IEnrollMFAAuthenticatorApp, IEnrollMFASMS, IForgotPassword, ILogin, ILoginWithMfa, IPasswordlessPreLogin, IPostLogin, IPreEnrollMFA, IPreEnrollMFASMS, IPreLogin, IPreVerifyMFA, IVerifyChangePhoneNumber, IVerifyMFAEmailCode, IVerifyMFASMS, IWebAuthnPreLogin, IWebAuthnPreLoginResponse } from '@frontegg/rest-api';
|
|
2
|
-
import { FronteggNextJSSession, HostedLoginCallback, IEnrollMFAWebAuthnPayload, IPasswordlessPostLoginPayload, IPreEnrollMFAWebAuthNForLoginResponse, IPreVerifyMFAWebAuthNForLoginResponse, IQuickSmsPasswordlessPreLoginPayload, IRecoverMFATokenPayload, IVerifyMFAWebAuthnPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginState, WithDeviceId } from './interfaces';
|
|
2
|
+
import { FronteggNextJSSession, HostedLoginCallback, IEnrollMFAWebAuthnPayload, IPasswordlessPostLoginPayload, IPreEnrollMFAWebAuthNForLoginResponse, IPreVerifyMFAWebAuthNForLoginResponse, IQuickSmsPasswordlessPreLoginPayload, IRecoverMFATokenPayload, IVerifyMFAWebAuthnPayload, IVerifyNewWebAuthnDevicePayload, IWebAuthnPostLoginPayload, LoginDirectAction, LoginState, WithDeviceId } from './interfaces';
|
|
3
3
|
import { WithCallback } from '../../interfaces';
|
|
4
4
|
import { IVerifyInviteToken } from '@frontegg/rest-api';
|
|
5
5
|
declare const loginState: LoginState;
|
|
@@ -113,10 +113,12 @@ declare const actions: {
|
|
|
113
113
|
additionalParams?: Record<string, string> | undefined;
|
|
114
114
|
shouldRedirectToLogin?: boolean | undefined;
|
|
115
115
|
firstTime?: boolean | undefined;
|
|
116
|
+
loginDirectAction?: LoginDirectAction | undefined;
|
|
116
117
|
} | undefined)?], {
|
|
117
118
|
additionalParams?: Record<string, string> | undefined;
|
|
118
119
|
shouldRedirectToLogin?: boolean | undefined;
|
|
119
120
|
firstTime?: boolean | undefined;
|
|
121
|
+
loginDirectAction?: LoginDirectAction | undefined;
|
|
120
122
|
} | undefined, string, never, never>;
|
|
121
123
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[HostedLoginCallback], HostedLoginCallback, string, never, never>;
|
|
122
124
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
@@ -188,6 +190,7 @@ declare type DispatchedActions = {
|
|
|
188
190
|
additionalParams?: Record<string, string>;
|
|
189
191
|
shouldRedirectToLogin?: boolean;
|
|
190
192
|
firstTime?: boolean;
|
|
193
|
+
loginDirectAction?: LoginDirectAction;
|
|
191
194
|
}) => void;
|
|
192
195
|
handleHostedLoginCallback: (payload: HostedLoginCallback) => void;
|
|
193
196
|
afterAuthNavigation: () => void;
|
|
@@ -97,3 +97,13 @@ export declare type IVerifyMFAWebAuthnPayload = WithCallback<WithDeviceId<Omit<I
|
|
|
97
97
|
export interface IRecoverMFATokenPayload extends WithCallback<IRecoverMFAToken> {
|
|
98
98
|
recaptchaToken?: string;
|
|
99
99
|
}
|
|
100
|
+
export declare enum LoginActionTypes {
|
|
101
|
+
'social-login' = "social-login",
|
|
102
|
+
'custom-social-login' = "custom-social-login",
|
|
103
|
+
'direct' = "direct"
|
|
104
|
+
}
|
|
105
|
+
export interface LoginDirectAction {
|
|
106
|
+
type: keyof typeof LoginActionTypes;
|
|
107
|
+
data: any;
|
|
108
|
+
additionalQueryParams?: Record<string, string>;
|
|
109
|
+
}
|
|
@@ -29,4 +29,10 @@ export let QuickLoginStrategy;
|
|
|
29
29
|
QuickLoginStrategy["Android"] = "android";
|
|
30
30
|
QuickLoginStrategy["Sms"] = "sms";
|
|
31
31
|
})(QuickLoginStrategy || (QuickLoginStrategy = {}));
|
|
32
|
-
export { AuthStrategyEnum };
|
|
32
|
+
export { AuthStrategyEnum };
|
|
33
|
+
export let LoginActionTypes;
|
|
34
|
+
(function (LoginActionTypes) {
|
|
35
|
+
LoginActionTypes["social-login"] = "social-login";
|
|
36
|
+
LoginActionTypes["custom-social-login"] = "custom-social-login";
|
|
37
|
+
LoginActionTypes["direct"] = "direct";
|
|
38
|
+
})(LoginActionTypes || (LoginActionTypes = {}));
|
package/auth/LoginState/saga.js
CHANGED
|
@@ -519,9 +519,11 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
519
519
|
payload: {
|
|
520
520
|
additionalParams,
|
|
521
521
|
shouldRedirectToLogin,
|
|
522
|
-
firstTime
|
|
522
|
+
firstTime,
|
|
523
|
+
loginDirectAction
|
|
523
524
|
}
|
|
524
525
|
}) {
|
|
526
|
+
var _additionalParams;
|
|
525
527
|
if (firstTime) {
|
|
526
528
|
const {
|
|
527
529
|
urlStrategy
|
|
@@ -541,7 +543,11 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
541
543
|
} = yield select(state => ({
|
|
542
544
|
disableSilentRefresh: state.auth.disableSilentRefresh
|
|
543
545
|
}));
|
|
544
|
-
if (
|
|
546
|
+
if (loginDirectAction) {
|
|
547
|
+
additionalParams = additionalParams || {};
|
|
548
|
+
additionalParams["login_direct_action"] = btoa(JSON.stringify(loginDirectAction));
|
|
549
|
+
}
|
|
550
|
+
if (((_additionalParams = additionalParams) == null ? void 0 : _additionalParams.prompt) === 'login') {
|
|
545
551
|
yield requestHostedLoginAuthorize(additionalParams);
|
|
546
552
|
return;
|
|
547
553
|
}
|
|
@@ -971,7 +977,7 @@ function* preLogin({
|
|
|
971
977
|
}));
|
|
972
978
|
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
973
979
|
}
|
|
974
|
-
if (FronteggNativeModule.isAvailable()) {
|
|
980
|
+
if (FronteggNativeModule.isAvailable("loginWithSSO")) {
|
|
975
981
|
FronteggNativeModule.loginWithSSO(email);
|
|
976
982
|
yield put(actions.setLoginState({
|
|
977
983
|
loading: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ISetSocialLoginError } from '@frontegg/rest-api';
|
|
2
2
|
import { ILoginViaSocialLoginPayload, SocialLoginState } from './interfaces';
|
|
3
|
+
import { WithCallback } from '../../interfaces';
|
|
3
4
|
declare const socialLoginState: SocialLoginState;
|
|
4
5
|
declare const reducers: {
|
|
5
6
|
setSocialLoginsState: {
|
|
@@ -105,7 +106,11 @@ declare const reducers: {
|
|
|
105
106
|
};
|
|
106
107
|
declare const actions: {
|
|
107
108
|
loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
108
|
-
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").
|
|
109
|
+
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[({
|
|
110
|
+
callback?: import("../../interfaces").CallbackMethod<SocialLoginState> | undefined;
|
|
111
|
+
} | undefined)?], {
|
|
112
|
+
callback?: import("../../interfaces").CallbackMethod<SocialLoginState> | undefined;
|
|
113
|
+
} | undefined, string, never, never>;
|
|
109
114
|
loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ILoginViaSocialLoginPayload], ILoginViaSocialLoginPayload, string, never, never>;
|
|
110
115
|
setSocialLoginError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[ISetSocialLoginError], ISetSocialLoginError, string, never, never>;
|
|
111
116
|
};
|
|
@@ -117,7 +122,7 @@ declare type DispatchedActions = {
|
|
|
117
122
|
setSocialLoginsState: (state: Partial<SocialLoginState>) => void;
|
|
118
123
|
resetSocialLoginsState: () => void;
|
|
119
124
|
loadSocialLoginsConfiguration: () => void;
|
|
120
|
-
loadSocialLoginsConfigurationV2: () => void;
|
|
125
|
+
loadSocialLoginsConfigurationV2: (payload?: WithCallback<{}, SocialLoginState>) => void;
|
|
121
126
|
loginViaSocialLogin: (payload: ILoginViaSocialLoginPayload) => void;
|
|
122
127
|
setSocialLoginError: (payload: ISetSocialLoginError) => void;
|
|
123
128
|
};
|
|
@@ -14,7 +14,9 @@ const reducers = {
|
|
|
14
14
|
};
|
|
15
15
|
const actions = {
|
|
16
16
|
loadSocialLoginsConfiguration: createAction(`${authStoreName}/loadSocialLoginsConfiguration`),
|
|
17
|
-
loadSocialLoginsConfigurationV2: createAction(`${authStoreName}/loadSocialLoginsConfigurationV2
|
|
17
|
+
loadSocialLoginsConfigurationV2: createAction(`${authStoreName}/loadSocialLoginsConfigurationV2`, payload => ({
|
|
18
|
+
payload
|
|
19
|
+
})),
|
|
18
20
|
loginViaSocialLogin: createAction(`${authStoreName}/loginViaSocialLogin`, payload => ({
|
|
19
21
|
payload
|
|
20
22
|
})),
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ContextOptions, ICustomSocialLoginProviderConfigurationV1, ISocialLoginProviderConfiguration, ISocialLoginProviderConfigurationV2 } from '@frontegg/rest-api';
|
|
2
|
+
import { SocialLoginState } from './interfaces';
|
|
3
|
+
import { WithCallback } from '../../interfaces';
|
|
2
4
|
export declare function loadSocialLoginsConfigurations(): Generator<import("redux-saga/effects").PutEffect<{
|
|
3
|
-
payload: Partial<
|
|
5
|
+
payload: Partial<SocialLoginState>;
|
|
4
6
|
type: string;
|
|
5
7
|
}> | import("redux-saga/effects").CallEffect<ISocialLoginProviderConfiguration[]>, void, ISocialLoginProviderConfiguration[]>;
|
|
6
8
|
export declare function getSocialLoginsConfigurationsV2(): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").CallEffect<ISocialLoginProviderConfigurationV2[]>, ISocialLoginProviderConfigurationV2[], (false & ISocialLoginProviderConfigurationV2[]) | (true & ISocialLoginProviderConfigurationV2[])>;
|
|
7
|
-
export declare function loadSocialLoginsConfigurationsV2(): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
8
|
-
payload: Partial<
|
|
9
|
+
export declare function loadSocialLoginsConfigurationsV2(payload?: WithCallback<{}, SocialLoginState>): Generator<import("redux-saga/effects").SelectEffect | import("redux-saga/effects").PutEffect<{
|
|
10
|
+
payload: Partial<SocialLoginState>;
|
|
9
11
|
type: string;
|
|
10
12
|
}> | import("redux-saga/effects").CallEffect<ISocialLoginProviderConfigurationV2[]> | import("redux-saga/effects").CallEffect<ICustomSocialLoginProviderConfigurationV1>, void, ContextOptions & ISocialLoginProviderConfigurationV2[] & ICustomSocialLoginProviderConfigurationV1>;
|
|
11
13
|
export declare function socialLoginsSaga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
|
|
@@ -40,8 +40,9 @@ export function* getSocialLoginsConfigurationsV2() {
|
|
|
40
40
|
}
|
|
41
41
|
return socialLoginsConfigV2;
|
|
42
42
|
}
|
|
43
|
-
export function* loadSocialLoginsConfigurationsV2() {
|
|
43
|
+
export function* loadSocialLoginsConfigurationsV2(payload) {
|
|
44
44
|
try {
|
|
45
|
+
var _payload$callback;
|
|
45
46
|
const context = yield select(state => state.root.context);
|
|
46
47
|
yield put(actions.setSocialLoginsState({
|
|
47
48
|
loading: true
|
|
@@ -60,13 +61,17 @@ export function* loadSocialLoginsConfigurationsV2() {
|
|
|
60
61
|
authorizationUrl: authorizationUrl ? `${baseUrl}${authorizationUrl}` : null
|
|
61
62
|
});
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
const newState = {
|
|
64
65
|
socialLoginsConfigV2: socialLoginsConfigWithFullUrl,
|
|
65
66
|
customSocialLoginsConfig,
|
|
66
67
|
loading: false,
|
|
67
68
|
firstLoad: false
|
|
68
|
-
}
|
|
69
|
+
};
|
|
70
|
+
yield put(actions.setSocialLoginsState(newState));
|
|
71
|
+
payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, newState);
|
|
69
72
|
} catch (e) {
|
|
73
|
+
var _payload$callback2;
|
|
74
|
+
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
70
75
|
yield put(actions.setSocialLoginsState({
|
|
71
76
|
error: errorHandler(e),
|
|
72
77
|
loading: false,
|
package/auth/index.d.ts
CHANGED
|
@@ -483,7 +483,11 @@ declare const _default: {
|
|
|
483
483
|
getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
|
|
484
484
|
resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>, string, never, never>;
|
|
485
485
|
loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
486
|
-
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").
|
|
486
|
+
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[({
|
|
487
|
+
callback?: import("..").CallbackMethod<import("./SocialLogins/interfaces").SocialLoginState> | undefined;
|
|
488
|
+
} | undefined)?], {
|
|
489
|
+
callback?: import("..").CallbackMethod<import("./SocialLogins/interfaces").SocialLoginState> | undefined;
|
|
490
|
+
} | undefined, string, never, never>;
|
|
487
491
|
loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload], import("./SocialLogins/interfaces").ILoginViaSocialLoginPayload, string, never, never>;
|
|
488
492
|
setSocialLoginError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ISetSocialLoginError], import("@frontegg/rest-api").ISetSocialLoginError, string, never, never>;
|
|
489
493
|
requestAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(boolean | undefined)?], boolean, string, never, never>;
|
|
@@ -493,10 +497,12 @@ declare const _default: {
|
|
|
493
497
|
additionalParams?: Record<string, string> | undefined;
|
|
494
498
|
shouldRedirectToLogin?: boolean | undefined;
|
|
495
499
|
firstTime?: boolean | undefined;
|
|
500
|
+
loginDirectAction?: import("./LoginState/interfaces").LoginDirectAction | undefined;
|
|
496
501
|
} | undefined)?], {
|
|
497
502
|
additionalParams?: Record<string, string> | undefined;
|
|
498
503
|
shouldRedirectToLogin?: boolean | undefined;
|
|
499
504
|
firstTime?: boolean | undefined;
|
|
505
|
+
loginDirectAction?: import("./LoginState/interfaces").LoginDirectAction | undefined;
|
|
500
506
|
} | undefined, string, never, never>;
|
|
501
507
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("./LoginState/interfaces").HostedLoginCallback], import("./LoginState/interfaces").HostedLoginCallback, string, never, never>;
|
|
502
508
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/auth/reducer.d.ts
CHANGED
|
@@ -442,7 +442,11 @@ declare const actions: {
|
|
|
442
442
|
getActivateAccountStrategy: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>], import("..").WithCallback<import("@frontegg/rest-api").IGetActivateAccountStrategy, import("@frontegg/rest-api").IGetActivateAccountStrategyResponse>, string, never, never>;
|
|
443
443
|
resendActivationEmail: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>], import("..").WithCallback<import("@frontegg/rest-api").IResendActivationEmail, boolean>, string, never, never>;
|
|
444
444
|
loadSocialLoginsConfiguration: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
|
445
|
-
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").
|
|
445
|
+
loadSocialLoginsConfigurationV2: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[({
|
|
446
|
+
callback?: import("..").CallbackMethod<import(".").SocialLoginState> | undefined;
|
|
447
|
+
} | undefined)?], {
|
|
448
|
+
callback?: import("..").CallbackMethod<import(".").SocialLoginState> | undefined;
|
|
449
|
+
} | undefined, string, never, never>;
|
|
446
450
|
loginViaSocialLogin: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").ILoginViaSocialLoginPayload], import(".").ILoginViaSocialLoginPayload, string, never, never>;
|
|
447
451
|
setSocialLoginError: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import("@frontegg/rest-api").ISetSocialLoginError], import("@frontegg/rest-api").ISetSocialLoginError, string, never, never>;
|
|
448
452
|
requestAuthorize: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[(boolean | undefined)?], boolean, string, never, never>;
|
|
@@ -452,10 +456,12 @@ declare const actions: {
|
|
|
452
456
|
additionalParams?: Record<string, string> | undefined;
|
|
453
457
|
shouldRedirectToLogin?: boolean | undefined;
|
|
454
458
|
firstTime?: boolean | undefined;
|
|
459
|
+
loginDirectAction?: import(".").LoginDirectAction | undefined;
|
|
455
460
|
} | undefined)?], {
|
|
456
461
|
additionalParams?: Record<string, string> | undefined;
|
|
457
462
|
shouldRedirectToLogin?: boolean | undefined;
|
|
458
463
|
firstTime?: boolean | undefined;
|
|
464
|
+
loginDirectAction?: import(".").LoginDirectAction | undefined;
|
|
459
465
|
} | undefined, string, never, never>;
|
|
460
466
|
handleHostedLoginCallback: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[import(".").HostedLoginCallback], import(".").HostedLoginCallback, string, never, never>;
|
|
461
467
|
afterAuthNavigation: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<string>;
|
package/index.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "AuthStrategyEnum", {
|
|
|
9
9
|
return _restApi.AuthStrategyEnum;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
exports.QuickLoginStrategy = exports.LoginStep = exports.LoginFlow = void 0;
|
|
12
|
+
exports.QuickLoginStrategy = exports.LoginStep = exports.LoginFlow = exports.LoginActionTypes = void 0;
|
|
13
13
|
var _restApi = require("@frontegg/rest-api");
|
|
14
14
|
let LoginStep;
|
|
15
15
|
exports.LoginStep = LoginStep;
|
|
@@ -43,4 +43,11 @@ exports.QuickLoginStrategy = QuickLoginStrategy;
|
|
|
43
43
|
QuickLoginStrategy["UsbKey"] = "usb-key";
|
|
44
44
|
QuickLoginStrategy["Android"] = "android";
|
|
45
45
|
QuickLoginStrategy["Sms"] = "sms";
|
|
46
|
-
})(QuickLoginStrategy || (exports.QuickLoginStrategy = QuickLoginStrategy = {}));
|
|
46
|
+
})(QuickLoginStrategy || (exports.QuickLoginStrategy = QuickLoginStrategy = {}));
|
|
47
|
+
let LoginActionTypes;
|
|
48
|
+
exports.LoginActionTypes = LoginActionTypes;
|
|
49
|
+
(function (LoginActionTypes) {
|
|
50
|
+
LoginActionTypes["social-login"] = "social-login";
|
|
51
|
+
LoginActionTypes["custom-social-login"] = "custom-social-login";
|
|
52
|
+
LoginActionTypes["direct"] = "direct";
|
|
53
|
+
})(LoginActionTypes || (exports.LoginActionTypes = LoginActionTypes = {}));
|
|
@@ -533,9 +533,11 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
533
533
|
payload: {
|
|
534
534
|
additionalParams,
|
|
535
535
|
shouldRedirectToLogin,
|
|
536
|
-
firstTime
|
|
536
|
+
firstTime,
|
|
537
|
+
loginDirectAction
|
|
537
538
|
}
|
|
538
539
|
}) {
|
|
540
|
+
var _additionalParams;
|
|
539
541
|
if (firstTime) {
|
|
540
542
|
const {
|
|
541
543
|
urlStrategy
|
|
@@ -555,7 +557,11 @@ function* refreshOrRequestHostedLoginAuthorizeV2({
|
|
|
555
557
|
} = yield (0, _effects.select)(state => ({
|
|
556
558
|
disableSilentRefresh: state.auth.disableSilentRefresh
|
|
557
559
|
}));
|
|
558
|
-
if (
|
|
560
|
+
if (loginDirectAction) {
|
|
561
|
+
additionalParams = additionalParams || {};
|
|
562
|
+
additionalParams["login_direct_action"] = btoa(JSON.stringify(loginDirectAction));
|
|
563
|
+
}
|
|
564
|
+
if (((_additionalParams = additionalParams) == null ? void 0 : _additionalParams.prompt) === 'login') {
|
|
559
565
|
yield requestHostedLoginAuthorize(additionalParams);
|
|
560
566
|
return;
|
|
561
567
|
}
|
|
@@ -985,7 +991,7 @@ function* preLogin({
|
|
|
985
991
|
}));
|
|
986
992
|
ssoRedirectUrl += `&redirect_uri=${window.location.origin}${oidcRedirectUrl}`;
|
|
987
993
|
}
|
|
988
|
-
if (_toolkit.FronteggNativeModule.isAvailable()) {
|
|
994
|
+
if (_toolkit.FronteggNativeModule.isAvailable("loginWithSSO")) {
|
|
989
995
|
_toolkit.FronteggNativeModule.loginWithSSO(email);
|
|
990
996
|
yield (0, _effects.put)(_reducer.actions.setLoginState({
|
|
991
997
|
loading: false,
|
|
@@ -22,7 +22,9 @@ const reducers = {
|
|
|
22
22
|
exports.socialLoginsReducer = reducers;
|
|
23
23
|
const actions = {
|
|
24
24
|
loadSocialLoginsConfiguration: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadSocialLoginsConfiguration`),
|
|
25
|
-
loadSocialLoginsConfigurationV2: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadSocialLoginsConfigurationV2
|
|
25
|
+
loadSocialLoginsConfigurationV2: (0, _toolkit.createAction)(`${_constants.authStoreName}/loadSocialLoginsConfigurationV2`, payload => ({
|
|
26
|
+
payload
|
|
27
|
+
})),
|
|
26
28
|
loginViaSocialLogin: (0, _toolkit.createAction)(`${_constants.authStoreName}/loginViaSocialLogin`, payload => ({
|
|
27
29
|
payload
|
|
28
30
|
})),
|
|
@@ -49,8 +49,9 @@ function* getSocialLoginsConfigurationsV2() {
|
|
|
49
49
|
}
|
|
50
50
|
return socialLoginsConfigV2;
|
|
51
51
|
}
|
|
52
|
-
function* loadSocialLoginsConfigurationsV2() {
|
|
52
|
+
function* loadSocialLoginsConfigurationsV2(payload) {
|
|
53
53
|
try {
|
|
54
|
+
var _payload$callback;
|
|
54
55
|
const context = yield (0, _effects.select)(state => state.root.context);
|
|
55
56
|
yield (0, _effects.put)(_reducer.actions.setSocialLoginsState({
|
|
56
57
|
loading: true
|
|
@@ -69,13 +70,17 @@ function* loadSocialLoginsConfigurationsV2() {
|
|
|
69
70
|
authorizationUrl: authorizationUrl ? `${baseUrl}${authorizationUrl}` : null
|
|
70
71
|
});
|
|
71
72
|
});
|
|
72
|
-
|
|
73
|
+
const newState = {
|
|
73
74
|
socialLoginsConfigV2: socialLoginsConfigWithFullUrl,
|
|
74
75
|
customSocialLoginsConfig,
|
|
75
76
|
loading: false,
|
|
76
77
|
firstLoad: false
|
|
77
|
-
}
|
|
78
|
+
};
|
|
79
|
+
yield (0, _effects.put)(_reducer.actions.setSocialLoginsState(newState));
|
|
80
|
+
payload == null ? void 0 : (_payload$callback = payload.callback) == null ? void 0 : _payload$callback.call(payload, newState);
|
|
78
81
|
} catch (e) {
|
|
82
|
+
var _payload$callback2;
|
|
83
|
+
payload == null ? void 0 : (_payload$callback2 = payload.callback) == null ? void 0 : _payload$callback2.call(payload, null, e);
|
|
79
84
|
yield (0, _effects.put)(_reducer.actions.setSocialLoginsState({
|
|
80
85
|
error: (0, _utils.errorHandler)(e),
|
|
81
86
|
loading: false,
|
package/node/index.js
CHANGED
|
@@ -42,8 +42,12 @@ class FronteggNativeModule {
|
|
|
42
42
|
isJsInterfaceAvailable() {
|
|
43
43
|
return window.FronteggNativeBridge != null;
|
|
44
44
|
}
|
|
45
|
-
isAvailable() {
|
|
46
|
-
|
|
45
|
+
isAvailable(method) {
|
|
46
|
+
if (this.isWebkitAvailable() || this.isJsInterfaceAvailable()) {
|
|
47
|
+
var _window$FronteggNativ3, _window$FronteggNativ4;
|
|
48
|
+
return (_window$FronteggNativ3 = (_window$FronteggNativ4 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ4[method]) != null ? _window$FronteggNativ3 : false;
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
53
|
var _default = new FronteggNativeModule();
|
package/package.json
CHANGED
|
@@ -12,12 +12,13 @@ declare global {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
FronteggNativeBridge?: FronteggNativeBridge;
|
|
15
|
+
FronteggNativeBridgeFunctions?: Record<string, boolean>;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
declare class FronteggNativeModule {
|
|
18
19
|
private isWebkitAvailable;
|
|
19
20
|
private isJsInterfaceAvailable;
|
|
20
|
-
isAvailable(): boolean;
|
|
21
|
+
isAvailable(method: string): boolean;
|
|
21
22
|
loginWithSSO: (email: string) => void;
|
|
22
23
|
loginWithSocialLogin: (url: string) => void;
|
|
23
24
|
}
|
|
@@ -36,8 +36,12 @@ class FronteggNativeModule {
|
|
|
36
36
|
isJsInterfaceAvailable() {
|
|
37
37
|
return window.FronteggNativeBridge != null;
|
|
38
38
|
}
|
|
39
|
-
isAvailable() {
|
|
40
|
-
|
|
39
|
+
isAvailable(method) {
|
|
40
|
+
if (this.isWebkitAvailable() || this.isJsInterfaceAvailable()) {
|
|
41
|
+
var _window$FronteggNativ3, _window$FronteggNativ4;
|
|
42
|
+
return (_window$FronteggNativ3 = (_window$FronteggNativ4 = window.FronteggNativeBridgeFunctions) == null ? void 0 : _window$FronteggNativ4[method]) != null ? _window$FronteggNativ3 : false;
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
export default new FronteggNativeModule();
|