@frontegg/redux-store 6.84.0-alpha.0 → 6.84.0-alpha.2
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/saga.js +3 -3
- package/auth/PasskeysState/helpers.d.ts +1 -1
- package/auth/PasskeysState/helpers.js +3 -2
- package/auth/interfaces.d.ts +4 -0
- package/auth/interfaces.js +2 -0
- package/index.js +1 -1
- package/node/auth/LoginState/saga.js +2 -2
- package/node/auth/PasskeysState/helpers.js +5 -4
- package/node/auth/interfaces.js +1 -0
- package/node/index.js +1 -1
- package/package.json +1 -1
package/auth/LoginState/saga.js
CHANGED
|
@@ -33,7 +33,7 @@ import { createRandomString, generateCodeChallenge, getFeatureFlags } from '../.
|
|
|
33
33
|
import { ResetPhoneNumberStep } from '../ResetPhoneNumberState/interfaces';
|
|
34
34
|
import { base64urlDecode, delay, publicKeyCredentialToJSON } from '../utils';
|
|
35
35
|
import { loadPublicAuthStrategiesPolicy } from '../SecurityPolicyState/saga';
|
|
36
|
-
import {
|
|
36
|
+
import { getPasskeysVendorPolicy } from '../PasskeysState/helpers';
|
|
37
37
|
import { getRedirectUrl } from './utils';
|
|
38
38
|
const authStrategyLoginStepMap = {
|
|
39
39
|
[AuthStrategyEnum.Code]: LoginStep.loginWithOtc,
|
|
@@ -781,10 +781,10 @@ export function* shouldShowPromptPasskeys() {
|
|
|
781
781
|
const {
|
|
782
782
|
policy
|
|
783
783
|
} = publicAuthStrategyPolicy;
|
|
784
|
-
const isPasskeysEnabledByVendor =
|
|
784
|
+
const isPasskeysEnabledByVendor = getPasskeysVendorPolicy(policy);
|
|
785
785
|
const isLoggedInWithPasskeys = localStorage.getItem('preferred-login-method') === 'Passkeys';
|
|
786
786
|
const isMarkedDontShowAgainPrompt = localStorage.getItem('dont-show-again-prompt-passkeys') === 'true';
|
|
787
|
-
const [showPasskeys] = yield call(getFeatureFlags, ['show-passkeys']);
|
|
787
|
+
const [showPasskeys] = yield call(getFeatureFlags, ['show-passkeys-new']);
|
|
788
788
|
if (!showPasskeys || !isPasskeysEnabledByVendor || isLoggedInWithPasskeys || isMarkedDontShowAgainPrompt) {
|
|
789
789
|
return false;
|
|
790
790
|
} else {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IAuthStrategiesConfig } from '@frontegg/rest-api';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getPasskeysVendorPolicy: (policy: IAuthStrategiesConfig) => boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SecondaryAuthStrategy } from '@frontegg/rest-api';
|
|
2
|
-
export const
|
|
3
|
-
|
|
2
|
+
export const getPasskeysVendorPolicy = policy => {
|
|
3
|
+
var _policy$secondaryAuth;
|
|
4
|
+
return !!(policy != null && (_policy$secondaryAuth = policy.secondaryAuthStrategies) != null && _policy$secondaryAuth.some(({
|
|
4
5
|
isActive,
|
|
5
6
|
strategy
|
|
6
7
|
}) => isActive && strategy === SecondaryAuthStrategy.Passkeys));
|
package/auth/interfaces.d.ts
CHANGED
|
@@ -22,12 +22,16 @@ import { ProvisioningState } from './Provisioning/interfaces';
|
|
|
22
22
|
import { ImpersonateState } from './ImpersonationState/interfaces';
|
|
23
23
|
import { PasskeysState } from './PasskeysState/interfaces';
|
|
24
24
|
import { GroupsDialogsState, GroupsState } from './GroupsState/interfaces';
|
|
25
|
+
interface Actor {
|
|
26
|
+
sub?: string;
|
|
27
|
+
}
|
|
25
28
|
export interface User extends IUserProfile {
|
|
26
29
|
accessToken: string;
|
|
27
30
|
refreshToken?: string;
|
|
28
31
|
expiresIn: number;
|
|
29
32
|
expires: string;
|
|
30
33
|
sid?: string;
|
|
34
|
+
act?: Actor;
|
|
31
35
|
}
|
|
32
36
|
export interface Routes {
|
|
33
37
|
routes: AuthPageRoutes;
|
package/auth/interfaces.js
CHANGED
package/index.js
CHANGED
|
@@ -798,10 +798,10 @@ function* shouldShowPromptPasskeys() {
|
|
|
798
798
|
const {
|
|
799
799
|
policy
|
|
800
800
|
} = publicAuthStrategyPolicy;
|
|
801
|
-
const isPasskeysEnabledByVendor = (0, _helpers2.
|
|
801
|
+
const isPasskeysEnabledByVendor = (0, _helpers2.getPasskeysVendorPolicy)(policy);
|
|
802
802
|
const isLoggedInWithPasskeys = localStorage.getItem('preferred-login-method') === 'Passkeys';
|
|
803
803
|
const isMarkedDontShowAgainPrompt = localStorage.getItem('dont-show-again-prompt-passkeys') === 'true';
|
|
804
|
-
const [showPasskeys] = yield (0, _effects.call)(_helpers.getFeatureFlags, ['show-passkeys']);
|
|
804
|
+
const [showPasskeys] = yield (0, _effects.call)(_helpers.getFeatureFlags, ['show-passkeys-new']);
|
|
805
805
|
if (!showPasskeys || !isPasskeysEnabledByVendor || isLoggedInWithPasskeys || isMarkedDontShowAgainPrompt) {
|
|
806
806
|
return false;
|
|
807
807
|
} else {
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getPasskeysVendorPolicy = void 0;
|
|
7
7
|
var _restApi = require("@frontegg/rest-api");
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const getPasskeysVendorPolicy = policy => {
|
|
9
|
+
var _policy$secondaryAuth;
|
|
10
|
+
return !!(policy != null && (_policy$secondaryAuth = policy.secondaryAuthStrategies) != null && _policy$secondaryAuth.some(({
|
|
10
11
|
isActive,
|
|
11
12
|
strategy
|
|
12
13
|
}) => isActive && strategy === _restApi.SecondaryAuthStrategy.Passkeys));
|
|
13
14
|
};
|
|
14
|
-
exports.
|
|
15
|
+
exports.getPasskeysVendorPolicy = getPasskeysVendorPolicy;
|
package/node/auth/interfaces.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.UserVeirifedOriginTypes = exports.AuthenticationTypes = exports.AdminPortalPagesForEvents = exports.AdminPortalPages = void 0;
|
|
7
|
+
//TODO: move act to IUserProfile in rest-api
|
|
7
8
|
let UserVeirifedOriginTypes;
|
|
8
9
|
exports.UserVeirifedOriginTypes = UserVeirifedOriginTypes;
|
|
9
10
|
(function (UserVeirifedOriginTypes) {
|
package/node/index.js
CHANGED