@asgardeo/react 0.8.0 → 0.9.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/dist/cjs/index.js +477 -184
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.js +298 -5
- package/dist/index.js.map +4 -4
- package/dist/utils/v2/passkey.d.ts +31 -0
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -37,7 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
AlertTitle: () => AlertTitle,
|
|
38
38
|
AsgardeoContext: () => AsgardeoContext_default,
|
|
39
39
|
AsgardeoProvider: () => AsgardeoProvider_default,
|
|
40
|
-
AsgardeoRuntimeError: () =>
|
|
40
|
+
AsgardeoRuntimeError: () => import_browser81.AsgardeoRuntimeError,
|
|
41
41
|
BaseAcceptInvite: () => BaseAcceptInvite_default,
|
|
42
42
|
BaseCreateOrganization: () => BaseCreateOrganization,
|
|
43
43
|
BaseInviteUser: () => BaseInviteUser_default,
|
|
@@ -71,12 +71,12 @@ __export(index_exports, {
|
|
|
71
71
|
DatePicker: () => DatePicker_default,
|
|
72
72
|
Divider: () => Divider_default,
|
|
73
73
|
EmailOtp: () => EmailOtp_default,
|
|
74
|
-
EmbeddedFlowActionVariant: () =>
|
|
75
|
-
EmbeddedFlowComponentType: () =>
|
|
76
|
-
EmbeddedFlowEventType: () =>
|
|
77
|
-
EmbeddedFlowTextVariant: () =>
|
|
78
|
-
EmbeddedSignInFlowStatus: () =>
|
|
79
|
-
EmbeddedSignInFlowType: () =>
|
|
74
|
+
EmbeddedFlowActionVariant: () => import_browser81.EmbeddedFlowActionVariantV2,
|
|
75
|
+
EmbeddedFlowComponentType: () => import_browser81.EmbeddedFlowComponentTypeV2,
|
|
76
|
+
EmbeddedFlowEventType: () => import_browser81.EmbeddedFlowEventTypeV2,
|
|
77
|
+
EmbeddedFlowTextVariant: () => import_browser81.EmbeddedFlowTextVariantV2,
|
|
78
|
+
EmbeddedSignInFlowStatus: () => import_browser81.EmbeddedSignInFlowStatusV2,
|
|
79
|
+
EmbeddedSignInFlowType: () => import_browser81.EmbeddedSignInFlowTypeV2,
|
|
80
80
|
Eye: () => Eye_default,
|
|
81
81
|
EyeOff: () => EyeOff_default,
|
|
82
82
|
FacebookButton: () => FacebookButton_default,
|
|
@@ -135,17 +135,17 @@ __export(index_exports, {
|
|
|
135
135
|
UsernamePassword: () => UsernamePassword_default,
|
|
136
136
|
createField: () => createField,
|
|
137
137
|
createOrganization: () => createOrganization_default,
|
|
138
|
-
createPatchOperations: () =>
|
|
138
|
+
createPatchOperations: () => import_browser80.createPatchOperations,
|
|
139
139
|
createSignInOption: () => createSignInOption,
|
|
140
140
|
createSignInOptionFromAuthenticator: () => createSignInOptionFromAuthenticator,
|
|
141
|
-
getActiveTheme: () =>
|
|
141
|
+
getActiveTheme: () => import_browser81.getActiveTheme,
|
|
142
142
|
getAllOrganizations: () => getAllOrganizations_default,
|
|
143
143
|
getMeOrganizations: () => getMeOrganizations_default,
|
|
144
144
|
getMeProfile: () => getScim2Me_default,
|
|
145
145
|
getOrganization: () => getOrganization_default,
|
|
146
146
|
getSchemas: () => getSchemas_default,
|
|
147
|
-
http: () =>
|
|
148
|
-
navigate: () =>
|
|
147
|
+
http: () => import_browser81.http,
|
|
148
|
+
navigate: () => import_browser81.navigate,
|
|
149
149
|
updateMeProfile: () => updateMeProfile_default,
|
|
150
150
|
updateOrganization: () => updateOrganization_default,
|
|
151
151
|
useAlertVariant: () => useAlertVariant,
|
|
@@ -913,8 +913,15 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
913
913
|
const firstArg = args[0];
|
|
914
914
|
const baseUrl = config?.baseUrl;
|
|
915
915
|
if (config.platform === import_browser6.Platform.AsgardeoV2) {
|
|
916
|
+
const authIdFromUrl = new URL(window.location.href).searchParams.get("authId");
|
|
917
|
+
const authIdFromStorage = sessionStorage.getItem("asgardeo_auth_id");
|
|
918
|
+
const authId = authIdFromUrl || authIdFromStorage;
|
|
919
|
+
if (authIdFromUrl && !authIdFromStorage) {
|
|
920
|
+
sessionStorage.setItem("asgardeo_auth_id", authIdFromUrl);
|
|
921
|
+
}
|
|
916
922
|
return (0, import_browser6.executeEmbeddedSignUpFlowV2)({
|
|
917
923
|
baseUrl,
|
|
924
|
+
authId,
|
|
918
925
|
payload: typeof firstArg === "object" && "flowType" in firstArg ? { ...firstArg, verbose: true } : firstArg
|
|
919
926
|
});
|
|
920
927
|
}
|
|
@@ -7764,11 +7771,159 @@ var BaseSignIn3 = (props) => {
|
|
|
7764
7771
|
var BaseSignIn_default3 = BaseSignIn3;
|
|
7765
7772
|
|
|
7766
7773
|
// src/components/presentation/auth/SignIn/SignIn.tsx
|
|
7767
|
-
var
|
|
7774
|
+
var import_browser50 = require("@asgardeo/browser");
|
|
7768
7775
|
|
|
7769
7776
|
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
7770
7777
|
var import_react59 = require("react");
|
|
7778
|
+
var import_browser49 = require("@asgardeo/browser");
|
|
7779
|
+
|
|
7780
|
+
// src/utils/v2/passkey.ts
|
|
7771
7781
|
var import_browser48 = require("@asgardeo/browser");
|
|
7782
|
+
var handlePasskeyRegistration = async (challengeData) => {
|
|
7783
|
+
if (!window.navigator.credentials || !window.navigator.credentials.create) {
|
|
7784
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7785
|
+
"WebAuthn is not supported in this browser.",
|
|
7786
|
+
"browser-webauthn-not-supported",
|
|
7787
|
+
"browser",
|
|
7788
|
+
"WebAuthn/Passkey registration requires a browser that supports the Web Authentication API."
|
|
7789
|
+
);
|
|
7790
|
+
}
|
|
7791
|
+
try {
|
|
7792
|
+
const creationOptions = JSON.parse(challengeData);
|
|
7793
|
+
const publicKey = {
|
|
7794
|
+
...creationOptions,
|
|
7795
|
+
challenge: (0, import_browser48.base64urlToArrayBuffer)(creationOptions.challenge),
|
|
7796
|
+
user: {
|
|
7797
|
+
...creationOptions.user,
|
|
7798
|
+
id: (0, import_browser48.base64urlToArrayBuffer)(creationOptions.user.id)
|
|
7799
|
+
},
|
|
7800
|
+
...creationOptions.excludeCredentials && {
|
|
7801
|
+
excludeCredentials: creationOptions.excludeCredentials.map((cred) => ({
|
|
7802
|
+
...cred,
|
|
7803
|
+
id: (0, import_browser48.base64urlToArrayBuffer)(cred.id)
|
|
7804
|
+
}))
|
|
7805
|
+
}
|
|
7806
|
+
};
|
|
7807
|
+
const credential = await navigator.credentials.create({
|
|
7808
|
+
publicKey
|
|
7809
|
+
});
|
|
7810
|
+
if (!credential) {
|
|
7811
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7812
|
+
"No credential returned from WebAuthn registration.",
|
|
7813
|
+
"browser-webauthn-no-credential",
|
|
7814
|
+
"browser",
|
|
7815
|
+
"The WebAuthn registration ceremony completed but did not return a valid credential."
|
|
7816
|
+
);
|
|
7817
|
+
}
|
|
7818
|
+
const response = credential.response;
|
|
7819
|
+
const registrationResponse = {
|
|
7820
|
+
id: credential.id,
|
|
7821
|
+
rawId: (0, import_browser48.arrayBufferToBase64url)(credential.rawId),
|
|
7822
|
+
type: credential.type,
|
|
7823
|
+
response: {
|
|
7824
|
+
attestationObject: (0, import_browser48.arrayBufferToBase64url)(response.attestationObject),
|
|
7825
|
+
clientDataJSON: (0, import_browser48.arrayBufferToBase64url)(response.clientDataJSON),
|
|
7826
|
+
...response.getTransports && {
|
|
7827
|
+
transports: response.getTransports()
|
|
7828
|
+
}
|
|
7829
|
+
},
|
|
7830
|
+
...credential.authenticatorAttachment && {
|
|
7831
|
+
authenticatorAttachment: credential.authenticatorAttachment
|
|
7832
|
+
}
|
|
7833
|
+
};
|
|
7834
|
+
return JSON.stringify(registrationResponse);
|
|
7835
|
+
} catch (error) {
|
|
7836
|
+
if (error instanceof import_browser48.AsgardeoRuntimeError) {
|
|
7837
|
+
throw error;
|
|
7838
|
+
}
|
|
7839
|
+
if (error instanceof Error) {
|
|
7840
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7841
|
+
`Passkey registration failed: ${error.message}`,
|
|
7842
|
+
"browser-webauthn-registration-error",
|
|
7843
|
+
"browser",
|
|
7844
|
+
`WebAuthn registration failed with error: ${error.name}`
|
|
7845
|
+
);
|
|
7846
|
+
}
|
|
7847
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7848
|
+
"Passkey registration failed due to an unexpected error.",
|
|
7849
|
+
"browser-webauthn-unexpected-error",
|
|
7850
|
+
"browser",
|
|
7851
|
+
"An unexpected error occurred during WebAuthn registration."
|
|
7852
|
+
);
|
|
7853
|
+
}
|
|
7854
|
+
};
|
|
7855
|
+
var handlePasskeyAuthentication = async (challengeData) => {
|
|
7856
|
+
if (!window.navigator.credentials || !window.navigator.credentials.get) {
|
|
7857
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7858
|
+
"WebAuthn is not supported in this browser.",
|
|
7859
|
+
"browser-webauthn-not-supported",
|
|
7860
|
+
"browser",
|
|
7861
|
+
"WebAuthn/Passkey authentication requires a browser that supports the Web Authentication API."
|
|
7862
|
+
);
|
|
7863
|
+
}
|
|
7864
|
+
try {
|
|
7865
|
+
const requestOptions = JSON.parse(challengeData);
|
|
7866
|
+
const publicKey = {
|
|
7867
|
+
...requestOptions,
|
|
7868
|
+
challenge: (0, import_browser48.base64urlToArrayBuffer)(requestOptions.challenge),
|
|
7869
|
+
...requestOptions.allowCredentials && {
|
|
7870
|
+
allowCredentials: requestOptions.allowCredentials.map((cred) => ({
|
|
7871
|
+
...cred,
|
|
7872
|
+
id: (0, import_browser48.base64urlToArrayBuffer)(cred.id)
|
|
7873
|
+
}))
|
|
7874
|
+
}
|
|
7875
|
+
};
|
|
7876
|
+
const credential = await navigator.credentials.get({
|
|
7877
|
+
publicKey
|
|
7878
|
+
});
|
|
7879
|
+
if (!credential) {
|
|
7880
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7881
|
+
"No credential returned from WebAuthn authentication.",
|
|
7882
|
+
"browser-webauthn-no-credential",
|
|
7883
|
+
"browser",
|
|
7884
|
+
"The WebAuthn authentication ceremony completed but did not return a valid credential."
|
|
7885
|
+
);
|
|
7886
|
+
}
|
|
7887
|
+
const response = credential.response;
|
|
7888
|
+
const authenticationResponse = {
|
|
7889
|
+
id: credential.id,
|
|
7890
|
+
rawId: (0, import_browser48.arrayBufferToBase64url)(credential.rawId),
|
|
7891
|
+
type: credential.type,
|
|
7892
|
+
response: {
|
|
7893
|
+
authenticatorData: (0, import_browser48.arrayBufferToBase64url)(response.authenticatorData),
|
|
7894
|
+
clientDataJSON: (0, import_browser48.arrayBufferToBase64url)(response.clientDataJSON),
|
|
7895
|
+
signature: (0, import_browser48.arrayBufferToBase64url)(response.signature),
|
|
7896
|
+
...response.userHandle && {
|
|
7897
|
+
userHandle: (0, import_browser48.arrayBufferToBase64url)(response.userHandle)
|
|
7898
|
+
}
|
|
7899
|
+
},
|
|
7900
|
+
...credential.authenticatorAttachment && {
|
|
7901
|
+
authenticatorAttachment: credential.authenticatorAttachment
|
|
7902
|
+
}
|
|
7903
|
+
};
|
|
7904
|
+
return JSON.stringify(authenticationResponse);
|
|
7905
|
+
} catch (error) {
|
|
7906
|
+
if (error instanceof import_browser48.AsgardeoRuntimeError) {
|
|
7907
|
+
throw error;
|
|
7908
|
+
}
|
|
7909
|
+
if (error instanceof Error) {
|
|
7910
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7911
|
+
`Passkey authentication failed: ${error.message}`,
|
|
7912
|
+
"browser-webauthn-authentication-error",
|
|
7913
|
+
"browser",
|
|
7914
|
+
`WebAuthn authentication failed with error: ${error.name}`
|
|
7915
|
+
);
|
|
7916
|
+
}
|
|
7917
|
+
throw new import_browser48.AsgardeoRuntimeError(
|
|
7918
|
+
"Passkey authentication failed due to an unexpected error.",
|
|
7919
|
+
"browser-webauthn-unexpected-error",
|
|
7920
|
+
"browser",
|
|
7921
|
+
"An unexpected error occurred during WebAuthn authentication."
|
|
7922
|
+
);
|
|
7923
|
+
}
|
|
7924
|
+
};
|
|
7925
|
+
|
|
7926
|
+
// src/components/presentation/auth/SignIn/v2/SignIn.tsx
|
|
7772
7927
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7773
7928
|
var SignIn = ({ className, size = "medium", onSuccess, onError, variant, children }) => {
|
|
7774
7929
|
const { applicationId, afterSignInUrl, signIn, isInitialized, isLoading } = useAsgardeo_default();
|
|
@@ -7778,8 +7933,17 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7778
7933
|
const [isFlowInitialized, setIsFlowInitialized] = (0, import_react59.useState)(false);
|
|
7779
7934
|
const [flowError, setFlowError] = (0, import_react59.useState)(null);
|
|
7780
7935
|
const [isSubmitting, setIsSubmitting] = (0, import_react59.useState)(false);
|
|
7936
|
+
const [passkeyState, setPasskeyState] = (0, import_react59.useState)({
|
|
7937
|
+
isActive: false,
|
|
7938
|
+
challenge: null,
|
|
7939
|
+
creationOptions: null,
|
|
7940
|
+
flowId: null,
|
|
7941
|
+
actionId: null,
|
|
7942
|
+
error: null
|
|
7943
|
+
});
|
|
7781
7944
|
const initializationAttemptedRef = (0, import_react59.useRef)(false);
|
|
7782
7945
|
const oauthCodeProcessedRef = (0, import_react59.useRef)(false);
|
|
7946
|
+
const passkeyProcessedRef = (0, import_react59.useRef)(false);
|
|
7783
7947
|
const setFlowId = (flowId) => {
|
|
7784
7948
|
setCurrentFlowId(flowId);
|
|
7785
7949
|
if (flowId) {
|
|
@@ -7838,7 +8002,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7838
8002
|
const handleOAuthError = (error, errorDescription) => {
|
|
7839
8003
|
clearFlowState();
|
|
7840
8004
|
const errorMessage = errorDescription || `OAuth error: ${error}`;
|
|
7841
|
-
const err = new
|
|
8005
|
+
const err = new import_browser49.AsgardeoRuntimeError(errorMessage, "SIGN_IN_ERROR", "react");
|
|
7842
8006
|
setError(err);
|
|
7843
8007
|
cleanupOAuthUrlParams(true);
|
|
7844
8008
|
};
|
|
@@ -7848,7 +8012,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7848
8012
|
onError?.(error);
|
|
7849
8013
|
};
|
|
7850
8014
|
const handleRedirection = (response) => {
|
|
7851
|
-
if (response.type ===
|
|
8015
|
+
if (response.type === import_browser49.EmbeddedSignInFlowTypeV2.Redirection) {
|
|
7852
8016
|
const redirectURL = response.data?.redirectURL || response?.redirectURL;
|
|
7853
8017
|
if (redirectURL && window?.location) {
|
|
7854
8018
|
if (response.flowId) {
|
|
@@ -7885,7 +8049,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7885
8049
|
handleAuthId(urlParams.authId);
|
|
7886
8050
|
const effectiveApplicationId = applicationId || urlParams.applicationId;
|
|
7887
8051
|
if (!urlParams.flowId && !effectiveApplicationId) {
|
|
7888
|
-
const error = new
|
|
8052
|
+
const error = new import_browser49.AsgardeoRuntimeError(
|
|
7889
8053
|
"Either flowId or applicationId is required for authentication",
|
|
7890
8054
|
"SIGN_IN_ERROR",
|
|
7891
8055
|
"react"
|
|
@@ -7903,7 +8067,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7903
8067
|
} else {
|
|
7904
8068
|
response = await signIn({
|
|
7905
8069
|
applicationId: effectiveApplicationId,
|
|
7906
|
-
flowType:
|
|
8070
|
+
flowType: import_browser49.EmbeddedFlowType.Authentication
|
|
7907
8071
|
});
|
|
7908
8072
|
}
|
|
7909
8073
|
if (handleRedirection(response)) {
|
|
@@ -7942,10 +8106,26 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7942
8106
|
if (handleRedirection(response)) {
|
|
7943
8107
|
return;
|
|
7944
8108
|
}
|
|
8109
|
+
if (response.data?.additionalData?.["passkeyChallenge"] || response.data?.additionalData?.["passkeyCreationOptions"]) {
|
|
8110
|
+
const passkeyChallenge = response.data.additionalData["passkeyChallenge"];
|
|
8111
|
+
const passkeyCreationOptions = response.data.additionalData["passkeyCreationOptions"];
|
|
8112
|
+
const effectiveFlowIdForPasskey = response.flowId || effectiveFlowId;
|
|
8113
|
+
passkeyProcessedRef.current = false;
|
|
8114
|
+
setPasskeyState({
|
|
8115
|
+
isActive: true,
|
|
8116
|
+
challenge: passkeyChallenge,
|
|
8117
|
+
creationOptions: passkeyCreationOptions,
|
|
8118
|
+
flowId: effectiveFlowIdForPasskey,
|
|
8119
|
+
actionId: "submit",
|
|
8120
|
+
error: null
|
|
8121
|
+
});
|
|
8122
|
+
setIsSubmitting(false);
|
|
8123
|
+
return;
|
|
8124
|
+
}
|
|
7945
8125
|
const { flowId, components: components2, ...rest } = normalizeFlowResponse(response, t, {
|
|
7946
8126
|
resolveTranslations: !children
|
|
7947
8127
|
});
|
|
7948
|
-
if (response.flowStatus ===
|
|
8128
|
+
if (response.flowStatus === import_browser49.EmbeddedSignInFlowStatusV2.Error) {
|
|
7949
8129
|
clearFlowState();
|
|
7950
8130
|
const failureReason = response?.failureReason;
|
|
7951
8131
|
const errorMessage = failureReason || "Authentication flow failed. Please try again.";
|
|
@@ -7954,7 +8134,7 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
7954
8134
|
cleanupFlowUrlParams();
|
|
7955
8135
|
throw err;
|
|
7956
8136
|
}
|
|
7957
|
-
if (response.flowStatus ===
|
|
8137
|
+
if (response.flowStatus === import_browser49.EmbeddedSignInFlowStatusV2.Complete) {
|
|
7958
8138
|
const redirectUrl = response?.redirectUrl || response?.redirect_uri;
|
|
7959
8139
|
const finalRedirectUrl = redirectUrl || afterSignInUrl;
|
|
7960
8140
|
setIsSubmitting(false);
|
|
@@ -8021,6 +8201,50 @@ var SignIn = ({ className, size = "medium", onSuccess, onError, variant, childre
|
|
|
8021
8201
|
cleanupOAuthUrlParams(true);
|
|
8022
8202
|
});
|
|
8023
8203
|
}, [isFlowInitialized, currentFlowId, isInitialized, isLoading, isSubmitting, signIn]);
|
|
8204
|
+
(0, import_react59.useEffect)(() => {
|
|
8205
|
+
if (!passkeyState.isActive || !passkeyState.challenge && !passkeyState.creationOptions || !passkeyState.flowId) {
|
|
8206
|
+
return;
|
|
8207
|
+
}
|
|
8208
|
+
if (passkeyProcessedRef.current) {
|
|
8209
|
+
return;
|
|
8210
|
+
}
|
|
8211
|
+
passkeyProcessedRef.current = true;
|
|
8212
|
+
const performPasskeyProcess = async () => {
|
|
8213
|
+
let inputs;
|
|
8214
|
+
if (passkeyState.challenge) {
|
|
8215
|
+
const passkeyResponse = await handlePasskeyAuthentication(passkeyState.challenge);
|
|
8216
|
+
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
8217
|
+
inputs = {
|
|
8218
|
+
credentialId: passkeyResponseObj.id,
|
|
8219
|
+
authenticatorData: passkeyResponseObj.response.authenticatorData,
|
|
8220
|
+
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
8221
|
+
signature: passkeyResponseObj.response.signature,
|
|
8222
|
+
userHandle: passkeyResponseObj.response.userHandle
|
|
8223
|
+
};
|
|
8224
|
+
} else if (passkeyState.creationOptions) {
|
|
8225
|
+
const passkeyResponse = await handlePasskeyRegistration(passkeyState.creationOptions);
|
|
8226
|
+
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
8227
|
+
inputs = {
|
|
8228
|
+
credentialId: passkeyResponseObj.id,
|
|
8229
|
+
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
8230
|
+
attestationObject: passkeyResponseObj.response.attestationObject
|
|
8231
|
+
};
|
|
8232
|
+
} else {
|
|
8233
|
+
throw new Error("No passkey challenge or creation options available");
|
|
8234
|
+
}
|
|
8235
|
+
await handleSubmit({
|
|
8236
|
+
flowId: passkeyState.flowId,
|
|
8237
|
+
inputs
|
|
8238
|
+
});
|
|
8239
|
+
};
|
|
8240
|
+
performPasskeyProcess().then(() => {
|
|
8241
|
+
setPasskeyState({ isActive: false, challenge: null, creationOptions: null, flowId: null, actionId: null, error: null });
|
|
8242
|
+
}).catch((error) => {
|
|
8243
|
+
setPasskeyState((prev) => ({ ...prev, isActive: false, error }));
|
|
8244
|
+
setFlowError(error);
|
|
8245
|
+
onError?.(error);
|
|
8246
|
+
});
|
|
8247
|
+
}, [passkeyState.isActive, passkeyState.challenge, passkeyState.creationOptions, passkeyState.flowId]);
|
|
8024
8248
|
if (children) {
|
|
8025
8249
|
const renderProps = {
|
|
8026
8250
|
initialize: initializeFlow,
|
|
@@ -8069,7 +8293,7 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
8069
8293
|
window.location.href = url.toString();
|
|
8070
8294
|
}
|
|
8071
8295
|
};
|
|
8072
|
-
if (platform ===
|
|
8296
|
+
if (platform === import_browser50.Platform.AsgardeoV2) {
|
|
8073
8297
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8074
8298
|
SignIn_default,
|
|
8075
8299
|
{
|
|
@@ -8102,18 +8326,18 @@ var SignIn2 = ({ className, size = "medium", children, ...rest }) => {
|
|
|
8102
8326
|
var SignIn_default2 = SignIn2;
|
|
8103
8327
|
|
|
8104
8328
|
// src/components/presentation/auth/SignUp/BaseSignUp.tsx
|
|
8105
|
-
var
|
|
8329
|
+
var import_browser61 = require("@asgardeo/browser");
|
|
8106
8330
|
|
|
8107
8331
|
// src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
|
|
8108
|
-
var
|
|
8332
|
+
var import_browser59 = require("@asgardeo/browser");
|
|
8109
8333
|
var import_css38 = require("@emotion/css");
|
|
8110
8334
|
var import_react61 = require("react");
|
|
8111
8335
|
|
|
8112
8336
|
// src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
|
|
8113
|
-
var
|
|
8337
|
+
var import_browser58 = require("@asgardeo/browser");
|
|
8114
8338
|
|
|
8115
8339
|
// src/components/adapters/CheckboxInput.tsx
|
|
8116
|
-
var
|
|
8340
|
+
var import_browser51 = require("@asgardeo/browser");
|
|
8117
8341
|
var CheckboxInput = ({
|
|
8118
8342
|
component,
|
|
8119
8343
|
formValues,
|
|
@@ -8127,7 +8351,7 @@ var CheckboxInput = ({
|
|
|
8127
8351
|
const value = formValues[fieldName] || false;
|
|
8128
8352
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8129
8353
|
return createField({
|
|
8130
|
-
type:
|
|
8354
|
+
type: import_browser51.FieldType.Checkbox,
|
|
8131
8355
|
name: fieldName,
|
|
8132
8356
|
label: config["label"] || "",
|
|
8133
8357
|
placeholder: config["placeholder"] || "",
|
|
@@ -8141,7 +8365,7 @@ var CheckboxInput = ({
|
|
|
8141
8365
|
var CheckboxInput_default = CheckboxInput;
|
|
8142
8366
|
|
|
8143
8367
|
// src/components/adapters/DateInput.tsx
|
|
8144
|
-
var
|
|
8368
|
+
var import_browser52 = require("@asgardeo/browser");
|
|
8145
8369
|
var DateInput = ({
|
|
8146
8370
|
component,
|
|
8147
8371
|
formValues,
|
|
@@ -8155,7 +8379,7 @@ var DateInput = ({
|
|
|
8155
8379
|
const value = formValues[fieldName] || "";
|
|
8156
8380
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8157
8381
|
return createField({
|
|
8158
|
-
type:
|
|
8382
|
+
type: import_browser52.FieldType.Date,
|
|
8159
8383
|
name: fieldName,
|
|
8160
8384
|
label: config["label"] || "",
|
|
8161
8385
|
placeholder: config["placeholder"] || "",
|
|
@@ -8188,7 +8412,7 @@ var DividerComponent = ({ component }) => {
|
|
|
8188
8412
|
var DividerComponent_default = DividerComponent;
|
|
8189
8413
|
|
|
8190
8414
|
// src/components/adapters/EmailInput.tsx
|
|
8191
|
-
var
|
|
8415
|
+
var import_browser53 = require("@asgardeo/browser");
|
|
8192
8416
|
var EmailInput = ({
|
|
8193
8417
|
component,
|
|
8194
8418
|
formValues,
|
|
@@ -8202,7 +8426,7 @@ var EmailInput = ({
|
|
|
8202
8426
|
const value = formValues[fieldName] || "";
|
|
8203
8427
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8204
8428
|
return createField({
|
|
8205
|
-
type:
|
|
8429
|
+
type: import_browser53.FieldType.Email,
|
|
8206
8430
|
name: fieldName,
|
|
8207
8431
|
label: config["label"] || "Email",
|
|
8208
8432
|
placeholder: config["placeholder"] || "Enter your email",
|
|
@@ -8273,7 +8497,7 @@ var ImageComponent = ({ component }) => {
|
|
|
8273
8497
|
var ImageComponent_default = ImageComponent;
|
|
8274
8498
|
|
|
8275
8499
|
// src/components/adapters/NumberInput.tsx
|
|
8276
|
-
var
|
|
8500
|
+
var import_browser54 = require("@asgardeo/browser");
|
|
8277
8501
|
var NumberInput = ({
|
|
8278
8502
|
component,
|
|
8279
8503
|
formValues,
|
|
@@ -8287,7 +8511,7 @@ var NumberInput = ({
|
|
|
8287
8511
|
const value = formValues[fieldName] || "";
|
|
8288
8512
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8289
8513
|
return createField({
|
|
8290
|
-
type:
|
|
8514
|
+
type: import_browser54.FieldType.Number,
|
|
8291
8515
|
name: fieldName,
|
|
8292
8516
|
label: config["label"] || "",
|
|
8293
8517
|
placeholder: config["placeholder"] || "",
|
|
@@ -8301,7 +8525,7 @@ var NumberInput = ({
|
|
|
8301
8525
|
var NumberInput_default = NumberInput;
|
|
8302
8526
|
|
|
8303
8527
|
// src/components/adapters/PasswordInput.tsx
|
|
8304
|
-
var
|
|
8528
|
+
var import_browser55 = require("@asgardeo/browser");
|
|
8305
8529
|
var PasswordInput = ({
|
|
8306
8530
|
component,
|
|
8307
8531
|
formValues,
|
|
@@ -8347,7 +8571,7 @@ var PasswordInput = ({
|
|
|
8347
8571
|
});
|
|
8348
8572
|
const hint = validationHints.length > 0 ? validationHints.join(", ") : config["hint"] || "";
|
|
8349
8573
|
return createField({
|
|
8350
|
-
type:
|
|
8574
|
+
type: import_browser55.FieldType.Password,
|
|
8351
8575
|
name: fieldName,
|
|
8352
8576
|
label: config["label"] || "Password",
|
|
8353
8577
|
placeholder: config["placeholder"] || "Enter your password",
|
|
@@ -8446,7 +8670,7 @@ var TelephoneInput = ({
|
|
|
8446
8670
|
var TelephoneInput_default = TelephoneInput;
|
|
8447
8671
|
|
|
8448
8672
|
// src/components/adapters/TextInput.tsx
|
|
8449
|
-
var
|
|
8673
|
+
var import_browser56 = require("@asgardeo/browser");
|
|
8450
8674
|
var TextInput = ({
|
|
8451
8675
|
component,
|
|
8452
8676
|
formValues,
|
|
@@ -8460,7 +8684,7 @@ var TextInput = ({
|
|
|
8460
8684
|
const value = formValues[fieldName] || "";
|
|
8461
8685
|
const error = touchedFields[fieldName] ? formErrors[fieldName] : void 0;
|
|
8462
8686
|
return createField({
|
|
8463
|
-
type:
|
|
8687
|
+
type: import_browser56.FieldType.Text,
|
|
8464
8688
|
name: fieldName,
|
|
8465
8689
|
label: config["label"] || "",
|
|
8466
8690
|
placeholder: config["placeholder"] || "",
|
|
@@ -8474,7 +8698,7 @@ var TextInput = ({
|
|
|
8474
8698
|
var TextInput_default = TextInput;
|
|
8475
8699
|
|
|
8476
8700
|
// src/components/adapters/SelectInput.tsx
|
|
8477
|
-
var
|
|
8701
|
+
var import_browser57 = require("@asgardeo/browser");
|
|
8478
8702
|
var SelectInput = ({
|
|
8479
8703
|
component,
|
|
8480
8704
|
formValues,
|
|
@@ -8493,7 +8717,7 @@ var SelectInput = ({
|
|
|
8493
8717
|
value: option
|
|
8494
8718
|
}));
|
|
8495
8719
|
return createField({
|
|
8496
|
-
type:
|
|
8720
|
+
type: import_browser57.FieldType.Select,
|
|
8497
8721
|
name: fieldName,
|
|
8498
8722
|
label: config["label"] || "",
|
|
8499
8723
|
placeholder: config["placeholder"] || "",
|
|
@@ -8565,9 +8789,9 @@ var Typography_default2 = TypographyComponent;
|
|
|
8565
8789
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
8566
8790
|
var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
8567
8791
|
switch (component.type) {
|
|
8568
|
-
case
|
|
8792
|
+
case import_browser58.EmbeddedFlowComponentType.Typography:
|
|
8569
8793
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Typography_default2, { component, onSubmit, ...rest });
|
|
8570
|
-
case
|
|
8794
|
+
case import_browser58.EmbeddedFlowComponentType.Input:
|
|
8571
8795
|
const inputVariant = component.variant?.toUpperCase();
|
|
8572
8796
|
const inputType = component.config["type"]?.toLowerCase();
|
|
8573
8797
|
if (inputVariant === "EMAIL" || inputType === "email") {
|
|
@@ -8589,7 +8813,7 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8589
8813
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(CheckboxInput_default, { component, onSubmit, ...rest });
|
|
8590
8814
|
}
|
|
8591
8815
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextInput_default, { component, onSubmit, ...rest });
|
|
8592
|
-
case
|
|
8816
|
+
case import_browser58.EmbeddedFlowComponentType.Button: {
|
|
8593
8817
|
const buttonVariant = component.variant?.toUpperCase();
|
|
8594
8818
|
const buttonText = component.config["text"] || component.config["label"] || "";
|
|
8595
8819
|
if (buttonVariant === "SOCIAL") {
|
|
@@ -8614,13 +8838,13 @@ var createSignUpComponent = ({ component, onSubmit, ...rest }) => {
|
|
|
8614
8838
|
}
|
|
8615
8839
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SubmitButton_default, { component, onSubmit, ...rest });
|
|
8616
8840
|
}
|
|
8617
|
-
case
|
|
8841
|
+
case import_browser58.EmbeddedFlowComponentType.Form:
|
|
8618
8842
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormContainer_default, { component, onSubmit, ...rest });
|
|
8619
|
-
case
|
|
8843
|
+
case import_browser58.EmbeddedFlowComponentType.Select:
|
|
8620
8844
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectInput_default, { component, onSubmit, ...rest });
|
|
8621
|
-
case
|
|
8845
|
+
case import_browser58.EmbeddedFlowComponentType.Divider:
|
|
8622
8846
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DividerComponent_default, { component, onSubmit, ...rest });
|
|
8623
|
-
case
|
|
8847
|
+
case import_browser58.EmbeddedFlowComponentType.Image:
|
|
8624
8848
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ImageComponent_default, { component, onSubmit, ...rest });
|
|
8625
8849
|
default:
|
|
8626
8850
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", {});
|
|
@@ -8868,7 +9092,7 @@ var BaseSignUpContent = ({
|
|
|
8868
9092
|
const fields = [];
|
|
8869
9093
|
const processComponents = (comps) => {
|
|
8870
9094
|
comps.forEach((component) => {
|
|
8871
|
-
if (component.type ===
|
|
9095
|
+
if (component.type === import_browser59.EmbeddedFlowComponentType.Input) {
|
|
8872
9096
|
const config = component.config || {};
|
|
8873
9097
|
fields.push({
|
|
8874
9098
|
name: config.name || component.id,
|
|
@@ -8961,11 +9185,11 @@ var BaseSignUpContent = ({
|
|
|
8961
9185
|
};
|
|
8962
9186
|
const response = await onSubmit(payload);
|
|
8963
9187
|
onFlowChange?.(response);
|
|
8964
|
-
if (response.flowStatus ===
|
|
9188
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
8965
9189
|
onComplete?.(response);
|
|
8966
9190
|
return;
|
|
8967
9191
|
}
|
|
8968
|
-
if (response.flowStatus ===
|
|
9192
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
8969
9193
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
8970
9194
|
return;
|
|
8971
9195
|
}
|
|
@@ -8980,7 +9204,7 @@ var BaseSignUpContent = ({
|
|
|
8980
9204
|
}
|
|
8981
9205
|
};
|
|
8982
9206
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
8983
|
-
if (response?.type ===
|
|
9207
|
+
if (response?.type === import_browser59.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
8984
9208
|
const redirectUrl = response.data.redirectURL;
|
|
8985
9209
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
8986
9210
|
if (!popup) {
|
|
@@ -9009,9 +9233,9 @@ var BaseSignUpContent = ({
|
|
|
9009
9233
|
try {
|
|
9010
9234
|
const continueResponse = await onSubmit(payload);
|
|
9011
9235
|
onFlowChange?.(continueResponse);
|
|
9012
|
-
if (continueResponse.flowStatus ===
|
|
9236
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
9013
9237
|
onComplete?.(continueResponse);
|
|
9014
|
-
} else if (continueResponse.flowStatus ===
|
|
9238
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
9015
9239
|
setCurrentFlow(continueResponse);
|
|
9016
9240
|
setupFormFields(continueResponse);
|
|
9017
9241
|
}
|
|
@@ -9069,9 +9293,9 @@ var BaseSignUpContent = ({
|
|
|
9069
9293
|
try {
|
|
9070
9294
|
const continueResponse = await onSubmit(payload);
|
|
9071
9295
|
onFlowChange?.(continueResponse);
|
|
9072
|
-
if (continueResponse.flowStatus ===
|
|
9296
|
+
if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
9073
9297
|
onComplete?.(continueResponse);
|
|
9074
|
-
} else if (continueResponse.flowStatus ===
|
|
9298
|
+
} else if (continueResponse.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
9075
9299
|
setCurrentFlow(continueResponse);
|
|
9076
9300
|
setupFormFields(continueResponse);
|
|
9077
9301
|
}
|
|
@@ -9095,30 +9319,30 @@ var BaseSignUpContent = ({
|
|
|
9095
9319
|
};
|
|
9096
9320
|
const containerClasses = (0, import_css38.cx)(
|
|
9097
9321
|
[
|
|
9098
|
-
(0,
|
|
9099
|
-
(0,
|
|
9100
|
-
(0,
|
|
9322
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup"),
|
|
9323
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
9324
|
+
(0, import_browser59.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
9101
9325
|
],
|
|
9102
9326
|
className
|
|
9103
9327
|
);
|
|
9104
9328
|
const inputClasses = (0, import_css38.cx)(
|
|
9105
9329
|
[
|
|
9106
|
-
(0,
|
|
9107
|
-
size === "small" && (0,
|
|
9108
|
-
size === "large" && (0,
|
|
9330
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup__input"),
|
|
9331
|
+
size === "small" && (0, import_browser59.withVendorCSSClassPrefix)("signup__input--small"),
|
|
9332
|
+
size === "large" && (0, import_browser59.withVendorCSSClassPrefix)("signup__input--large")
|
|
9109
9333
|
],
|
|
9110
9334
|
inputClassName
|
|
9111
9335
|
);
|
|
9112
9336
|
const buttonClasses = (0, import_css38.cx)(
|
|
9113
9337
|
[
|
|
9114
|
-
(0,
|
|
9115
|
-
size === "small" && (0,
|
|
9116
|
-
size === "large" && (0,
|
|
9338
|
+
(0, import_browser59.withVendorCSSClassPrefix)("signup__button"),
|
|
9339
|
+
size === "small" && (0, import_browser59.withVendorCSSClassPrefix)("signup__button--small"),
|
|
9340
|
+
size === "large" && (0, import_browser59.withVendorCSSClassPrefix)("signup__button--large")
|
|
9117
9341
|
],
|
|
9118
9342
|
buttonClassName
|
|
9119
9343
|
);
|
|
9120
|
-
const errorClasses = (0, import_css38.cx)([(0,
|
|
9121
|
-
const messageClasses = (0, import_css38.cx)([(0,
|
|
9344
|
+
const errorClasses = (0, import_css38.cx)([(0, import_browser59.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
9345
|
+
const messageClasses = (0, import_css38.cx)([(0, import_browser59.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
9122
9346
|
const renderComponents = (0, import_react61.useCallback)(
|
|
9123
9347
|
(components) => renderSignUpComponents2(
|
|
9124
9348
|
components,
|
|
@@ -9160,11 +9384,11 @@ var BaseSignUpContent = ({
|
|
|
9160
9384
|
setCurrentFlow(response);
|
|
9161
9385
|
setIsFlowInitialized(true);
|
|
9162
9386
|
onFlowChange?.(response);
|
|
9163
|
-
if (response.flowStatus ===
|
|
9387
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Complete) {
|
|
9164
9388
|
onComplete?.(response);
|
|
9165
9389
|
return;
|
|
9166
9390
|
}
|
|
9167
|
-
if (response.flowStatus ===
|
|
9391
|
+
if (response.flowStatus === import_browser59.EmbeddedFlowStatus.Incomplete) {
|
|
9168
9392
|
setupFormFields(response);
|
|
9169
9393
|
}
|
|
9170
9394
|
} catch (err) {
|
|
@@ -9234,7 +9458,7 @@ var BaseSignUpContent = ({
|
|
|
9234
9458
|
var BaseSignUp_default = BaseSignUp;
|
|
9235
9459
|
|
|
9236
9460
|
// src/components/presentation/auth/SignUp/v2/BaseSignUp.tsx
|
|
9237
|
-
var
|
|
9461
|
+
var import_browser60 = require("@asgardeo/browser");
|
|
9238
9462
|
var import_css39 = require("@emotion/css");
|
|
9239
9463
|
var import_react62 = require("react");
|
|
9240
9464
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
@@ -9287,7 +9511,15 @@ var BaseSignUpContent2 = ({
|
|
|
9287
9511
|
const [isFlowInitialized, setIsFlowInitialized] = (0, import_react62.useState)(false);
|
|
9288
9512
|
const [currentFlow, setCurrentFlow] = (0, import_react62.useState)(null);
|
|
9289
9513
|
const [apiError, setApiError] = (0, import_react62.useState)(null);
|
|
9514
|
+
const [passkeyState, setPasskeyState] = (0, import_react62.useState)({
|
|
9515
|
+
isActive: false,
|
|
9516
|
+
creationOptions: null,
|
|
9517
|
+
flowId: null,
|
|
9518
|
+
actionId: null,
|
|
9519
|
+
error: null
|
|
9520
|
+
});
|
|
9290
9521
|
const initializationAttemptedRef = (0, import_react62.useRef)(false);
|
|
9522
|
+
const passkeyProcessedRef = (0, import_react62.useRef)(false);
|
|
9291
9523
|
const normalizeFlowResponseLocal = (0, import_react62.useCallback)(
|
|
9292
9524
|
(response) => {
|
|
9293
9525
|
if (response?.data?.components && Array.isArray(response.data.components)) {
|
|
@@ -9319,7 +9551,7 @@ var BaseSignUpContent2 = ({
|
|
|
9319
9551
|
const fields = [];
|
|
9320
9552
|
const processComponents = (comps) => {
|
|
9321
9553
|
comps.forEach((component) => {
|
|
9322
|
-
if (component.type ===
|
|
9554
|
+
if (component.type === import_browser60.EmbeddedFlowComponentTypeV2.TextInput || component.type === import_browser60.EmbeddedFlowComponentTypeV2.PasswordInput || component.type === import_browser60.EmbeddedFlowComponentTypeV2.EmailInput || component.type === import_browser60.EmbeddedFlowComponentTypeV2.Select) {
|
|
9323
9555
|
const fieldName = component.ref || component.id;
|
|
9324
9556
|
fields.push({
|
|
9325
9557
|
name: fieldName,
|
|
@@ -9329,7 +9561,7 @@ var BaseSignUpContent2 = ({
|
|
|
9329
9561
|
if (component.required && (!value || value.trim() === "")) {
|
|
9330
9562
|
return t("validations.required.field.error");
|
|
9331
9563
|
}
|
|
9332
|
-
if ((component.type ===
|
|
9564
|
+
if ((component.type === import_browser60.EmbeddedFlowComponentTypeV2.EmailInput || component.variant === "EMAIL") && value && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value)) {
|
|
9333
9565
|
return t("field.email.invalid");
|
|
9334
9566
|
}
|
|
9335
9567
|
return null;
|
|
@@ -9419,14 +9651,28 @@ var BaseSignUpContent2 = ({
|
|
|
9419
9651
|
const rawResponse = await onSubmit(payload);
|
|
9420
9652
|
const response = normalizeFlowResponseLocal(rawResponse);
|
|
9421
9653
|
onFlowChange?.(response);
|
|
9422
|
-
if (response.flowStatus ===
|
|
9654
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
9423
9655
|
onComplete?.(response);
|
|
9424
9656
|
return;
|
|
9425
9657
|
}
|
|
9426
|
-
if (response.flowStatus ===
|
|
9658
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
9427
9659
|
if (handleRedirectionIfNeeded(response, component)) {
|
|
9428
9660
|
return;
|
|
9429
9661
|
}
|
|
9662
|
+
if (response.data?.additionalData?.["passkeyCreationOptions"]) {
|
|
9663
|
+
const passkeyCreationOptions = response.data.additionalData["passkeyCreationOptions"];
|
|
9664
|
+
const effectiveFlowIdForPasskey = response.flowId || currentFlow?.flowId;
|
|
9665
|
+
passkeyProcessedRef.current = false;
|
|
9666
|
+
setPasskeyState({
|
|
9667
|
+
isActive: true,
|
|
9668
|
+
creationOptions: passkeyCreationOptions,
|
|
9669
|
+
flowId: effectiveFlowIdForPasskey,
|
|
9670
|
+
actionId: component.id || "submit",
|
|
9671
|
+
error: null
|
|
9672
|
+
});
|
|
9673
|
+
setIsLoading(false);
|
|
9674
|
+
return;
|
|
9675
|
+
}
|
|
9430
9676
|
setCurrentFlow(response);
|
|
9431
9677
|
setupFormFields(response);
|
|
9432
9678
|
}
|
|
@@ -9437,8 +9683,50 @@ var BaseSignUpContent2 = ({
|
|
|
9437
9683
|
setIsLoading(false);
|
|
9438
9684
|
}
|
|
9439
9685
|
};
|
|
9686
|
+
(0, import_react62.useEffect)(() => {
|
|
9687
|
+
if (!passkeyState.isActive || !passkeyState.creationOptions || !passkeyState.flowId) {
|
|
9688
|
+
return;
|
|
9689
|
+
}
|
|
9690
|
+
if (passkeyProcessedRef.current) {
|
|
9691
|
+
return;
|
|
9692
|
+
}
|
|
9693
|
+
passkeyProcessedRef.current = true;
|
|
9694
|
+
const performPasskeyRegistration = async () => {
|
|
9695
|
+
const passkeyResponse = await handlePasskeyRegistration(passkeyState.creationOptions);
|
|
9696
|
+
const passkeyResponseObj = JSON.parse(passkeyResponse);
|
|
9697
|
+
const inputs = {
|
|
9698
|
+
credentialId: passkeyResponseObj.id,
|
|
9699
|
+
clientDataJSON: passkeyResponseObj.response.clientDataJSON,
|
|
9700
|
+
attestationObject: passkeyResponseObj.response.attestationObject
|
|
9701
|
+
};
|
|
9702
|
+
const payload = {
|
|
9703
|
+
flowId: passkeyState.flowId,
|
|
9704
|
+
flowType: currentFlow?.flowType || "REGISTRATION",
|
|
9705
|
+
actionId: passkeyState.actionId || "submit",
|
|
9706
|
+
inputs
|
|
9707
|
+
};
|
|
9708
|
+
const nextResponse = await onSubmit(payload);
|
|
9709
|
+
const processedResponse = normalizeFlowResponseLocal(nextResponse);
|
|
9710
|
+
onFlowChange?.(processedResponse);
|
|
9711
|
+
if (processedResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
9712
|
+
onComplete?.(processedResponse);
|
|
9713
|
+
return;
|
|
9714
|
+
} else {
|
|
9715
|
+
setCurrentFlow(processedResponse);
|
|
9716
|
+
setupFormFields(processedResponse);
|
|
9717
|
+
return;
|
|
9718
|
+
}
|
|
9719
|
+
};
|
|
9720
|
+
performPasskeyRegistration().then(() => {
|
|
9721
|
+
setPasskeyState({ isActive: false, creationOptions: null, flowId: null, actionId: null, error: null });
|
|
9722
|
+
}).catch((error) => {
|
|
9723
|
+
setPasskeyState((prev) => ({ ...prev, isActive: false, error }));
|
|
9724
|
+
handleError(error);
|
|
9725
|
+
onError?.(error);
|
|
9726
|
+
});
|
|
9727
|
+
}, [passkeyState.isActive, passkeyState.creationOptions, passkeyState.flowId]);
|
|
9440
9728
|
const handleRedirectionIfNeeded = (response, component) => {
|
|
9441
|
-
if (response?.type ===
|
|
9729
|
+
if (response?.type === import_browser60.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL) {
|
|
9442
9730
|
const redirectUrl = response.data.redirectURL;
|
|
9443
9731
|
const popup = window.open(redirectUrl, "oauth_popup", "width=500,height=600,scrollbars=yes,resizable=yes");
|
|
9444
9732
|
if (!popup) {
|
|
@@ -9467,9 +9755,9 @@ var BaseSignUpContent2 = ({
|
|
|
9467
9755
|
try {
|
|
9468
9756
|
const continueResponse = await onSubmit(payload);
|
|
9469
9757
|
onFlowChange?.(continueResponse);
|
|
9470
|
-
if (continueResponse.flowStatus ===
|
|
9758
|
+
if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
9471
9759
|
onComplete?.(continueResponse);
|
|
9472
|
-
} else if (continueResponse.flowStatus ===
|
|
9760
|
+
} else if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
9473
9761
|
setCurrentFlow(continueResponse);
|
|
9474
9762
|
setupFormFields(continueResponse);
|
|
9475
9763
|
}
|
|
@@ -9527,9 +9815,9 @@ var BaseSignUpContent2 = ({
|
|
|
9527
9815
|
try {
|
|
9528
9816
|
const continueResponse = await onSubmit(payload);
|
|
9529
9817
|
onFlowChange?.(continueResponse);
|
|
9530
|
-
if (continueResponse.flowStatus ===
|
|
9818
|
+
if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
9531
9819
|
onComplete?.(continueResponse);
|
|
9532
|
-
} else if (continueResponse.flowStatus ===
|
|
9820
|
+
} else if (continueResponse.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
9533
9821
|
setCurrentFlow(continueResponse);
|
|
9534
9822
|
setupFormFields(continueResponse);
|
|
9535
9823
|
}
|
|
@@ -9553,30 +9841,30 @@ var BaseSignUpContent2 = ({
|
|
|
9553
9841
|
};
|
|
9554
9842
|
const containerClasses = (0, import_css39.cx)(
|
|
9555
9843
|
[
|
|
9556
|
-
(0,
|
|
9557
|
-
(0,
|
|
9558
|
-
(0,
|
|
9844
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup"),
|
|
9845
|
+
(0, import_browser60.withVendorCSSClassPrefix)(`signup--${size}`),
|
|
9846
|
+
(0, import_browser60.withVendorCSSClassPrefix)(`signup--${variant}`)
|
|
9559
9847
|
],
|
|
9560
9848
|
className
|
|
9561
9849
|
);
|
|
9562
9850
|
const inputClasses = (0, import_css39.cx)(
|
|
9563
9851
|
[
|
|
9564
|
-
(0,
|
|
9565
|
-
size === "small" && (0,
|
|
9566
|
-
size === "large" && (0,
|
|
9852
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup__input"),
|
|
9853
|
+
size === "small" && (0, import_browser60.withVendorCSSClassPrefix)("signup__input--small"),
|
|
9854
|
+
size === "large" && (0, import_browser60.withVendorCSSClassPrefix)("signup__input--large")
|
|
9567
9855
|
],
|
|
9568
9856
|
inputClassName
|
|
9569
9857
|
);
|
|
9570
9858
|
const buttonClasses = (0, import_css39.cx)(
|
|
9571
9859
|
[
|
|
9572
|
-
(0,
|
|
9573
|
-
size === "small" && (0,
|
|
9574
|
-
size === "large" && (0,
|
|
9860
|
+
(0, import_browser60.withVendorCSSClassPrefix)("signup__button"),
|
|
9861
|
+
size === "small" && (0, import_browser60.withVendorCSSClassPrefix)("signup__button--small"),
|
|
9862
|
+
size === "large" && (0, import_browser60.withVendorCSSClassPrefix)("signup__button--large")
|
|
9575
9863
|
],
|
|
9576
9864
|
buttonClassName
|
|
9577
9865
|
);
|
|
9578
|
-
const errorClasses = (0, import_css39.cx)([(0,
|
|
9579
|
-
const messageClasses = (0, import_css39.cx)([(0,
|
|
9866
|
+
const errorClasses = (0, import_css39.cx)([(0, import_browser60.withVendorCSSClassPrefix)("signup__error")], errorClassName);
|
|
9867
|
+
const messageClasses = (0, import_css39.cx)([(0, import_browser60.withVendorCSSClassPrefix)("signup__messages")], messageClassName);
|
|
9580
9868
|
const renderComponents = (0, import_react62.useCallback)(
|
|
9581
9869
|
(components) => renderSignUpComponents(
|
|
9582
9870
|
components,
|
|
@@ -9634,11 +9922,11 @@ var BaseSignUpContent2 = ({
|
|
|
9634
9922
|
setCurrentFlow(response);
|
|
9635
9923
|
setIsFlowInitialized(true);
|
|
9636
9924
|
onFlowChange?.(response);
|
|
9637
|
-
if (response.flowStatus ===
|
|
9925
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Complete) {
|
|
9638
9926
|
onComplete?.(response);
|
|
9639
9927
|
return;
|
|
9640
9928
|
}
|
|
9641
|
-
if (response.flowStatus ===
|
|
9929
|
+
if (response.flowStatus === import_browser60.EmbeddedFlowStatus.Incomplete) {
|
|
9642
9930
|
setupFormFields(response);
|
|
9643
9931
|
}
|
|
9644
9932
|
} catch (err) {
|
|
@@ -9725,7 +10013,7 @@ var BaseSignUp_default2 = BaseSignUp2;
|
|
|
9725
10013
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
9726
10014
|
var BaseSignUp3 = (props) => {
|
|
9727
10015
|
const { platform } = useAsgardeo_default();
|
|
9728
|
-
if (platform ===
|
|
10016
|
+
if (platform === import_browser61.Platform.AsgardeoV2) {
|
|
9729
10017
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BaseSignUp_default2, { ...props });
|
|
9730
10018
|
}
|
|
9731
10019
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(BaseSignUp_default, { ...props });
|
|
@@ -9733,10 +10021,10 @@ var BaseSignUp3 = (props) => {
|
|
|
9733
10021
|
var BaseSignUp_default3 = BaseSignUp3;
|
|
9734
10022
|
|
|
9735
10023
|
// src/components/presentation/auth/SignUp/SignUp.tsx
|
|
9736
|
-
var
|
|
10024
|
+
var import_browser64 = require("@asgardeo/browser");
|
|
9737
10025
|
|
|
9738
10026
|
// src/components/presentation/auth/SignUp/v1/SignUp.tsx
|
|
9739
|
-
var
|
|
10027
|
+
var import_browser62 = require("@asgardeo/browser");
|
|
9740
10028
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
9741
10029
|
var SignUp = ({
|
|
9742
10030
|
className,
|
|
@@ -9751,17 +10039,17 @@ var SignUp = ({
|
|
|
9751
10039
|
const { signUp, isInitialized } = useAsgardeo_default();
|
|
9752
10040
|
const handleInitialize = async (payload) => {
|
|
9753
10041
|
const initialPayload = payload || {
|
|
9754
|
-
flowType:
|
|
10042
|
+
flowType: import_browser62.EmbeddedFlowType.Registration
|
|
9755
10043
|
};
|
|
9756
10044
|
return await signUp(initialPayload);
|
|
9757
10045
|
};
|
|
9758
10046
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
9759
10047
|
const handleComplete = (response) => {
|
|
9760
10048
|
onComplete?.(response);
|
|
9761
|
-
if (shouldRedirectAfterSignUp && response?.type !==
|
|
10049
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser62.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
9762
10050
|
window.location.href = afterSignUpUrl;
|
|
9763
10051
|
}
|
|
9764
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
10052
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser62.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
9765
10053
|
!response.data.redirectURL.includes("auth")) {
|
|
9766
10054
|
window.location.href = response.data.redirectURL;
|
|
9767
10055
|
}
|
|
@@ -9788,7 +10076,7 @@ var SignUp = ({
|
|
|
9788
10076
|
var SignUp_default = SignUp;
|
|
9789
10077
|
|
|
9790
10078
|
// src/components/presentation/auth/SignUp/v2/SignUp.tsx
|
|
9791
|
-
var
|
|
10079
|
+
var import_browser63 = require("@asgardeo/browser");
|
|
9792
10080
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
9793
10081
|
var SignUp2 = ({
|
|
9794
10082
|
className,
|
|
@@ -9806,7 +10094,7 @@ var SignUp2 = ({
|
|
|
9806
10094
|
const applicationIdFromUrl = urlParams.get("applicationId");
|
|
9807
10095
|
const effectiveApplicationId = applicationId || applicationIdFromUrl;
|
|
9808
10096
|
const initialPayload = payload || {
|
|
9809
|
-
flowType:
|
|
10097
|
+
flowType: import_browser63.EmbeddedFlowType.Registration,
|
|
9810
10098
|
...effectiveApplicationId && { applicationId: effectiveApplicationId }
|
|
9811
10099
|
};
|
|
9812
10100
|
return await signUp(initialPayload);
|
|
@@ -9814,10 +10102,15 @@ var SignUp2 = ({
|
|
|
9814
10102
|
const handleOnSubmit = async (payload) => await signUp(payload);
|
|
9815
10103
|
const handleComplete = (response) => {
|
|
9816
10104
|
onComplete?.(response);
|
|
9817
|
-
|
|
10105
|
+
const oauthRedirectUrl = response?.redirectUrl;
|
|
10106
|
+
if (shouldRedirectAfterSignUp && oauthRedirectUrl) {
|
|
10107
|
+
window.location.href = oauthRedirectUrl;
|
|
10108
|
+
return;
|
|
10109
|
+
}
|
|
10110
|
+
if (shouldRedirectAfterSignUp && response?.type !== import_browser63.EmbeddedFlowResponseType.Redirection && afterSignUpUrl) {
|
|
9818
10111
|
window.location.href = afterSignUpUrl;
|
|
9819
10112
|
}
|
|
9820
|
-
if (shouldRedirectAfterSignUp && response?.type ===
|
|
10113
|
+
if (shouldRedirectAfterSignUp && response?.type === import_browser63.EmbeddedFlowResponseType.Redirection && response?.data?.redirectURL && !response.data.redirectURL.includes("oauth") && // Not a social provider redirect
|
|
9821
10114
|
!response.data.redirectURL.includes("auth")) {
|
|
9822
10115
|
window.location.href = response.data.redirectURL;
|
|
9823
10116
|
}
|
|
@@ -9847,7 +10140,7 @@ var SignUp_default2 = SignUp2;
|
|
|
9847
10140
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
9848
10141
|
var SignUp3 = (props) => {
|
|
9849
10142
|
const { platform } = useAsgardeo_default();
|
|
9850
|
-
if (platform ===
|
|
10143
|
+
if (platform === import_browser64.Platform.AsgardeoV2) {
|
|
9851
10144
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SignUp_default2, { ...props });
|
|
9852
10145
|
}
|
|
9853
10146
|
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(SignUp_default, { ...props });
|
|
@@ -9855,11 +10148,11 @@ var SignUp3 = (props) => {
|
|
|
9855
10148
|
var SignUp_default3 = SignUp3;
|
|
9856
10149
|
|
|
9857
10150
|
// src/components/presentation/auth/InviteUser/v2/InviteUser.tsx
|
|
9858
|
-
var
|
|
10151
|
+
var import_browser66 = require("@asgardeo/browser");
|
|
9859
10152
|
|
|
9860
10153
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.tsx
|
|
9861
10154
|
var import_react64 = require("react");
|
|
9862
|
-
var
|
|
10155
|
+
var import_browser65 = require("@asgardeo/browser");
|
|
9863
10156
|
var import_css41 = require("@emotion/css");
|
|
9864
10157
|
|
|
9865
10158
|
// src/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.ts
|
|
@@ -10088,7 +10381,7 @@ var BaseInviteUser = ({
|
|
|
10088
10381
|
setApiError(null);
|
|
10089
10382
|
try {
|
|
10090
10383
|
const payload = {
|
|
10091
|
-
flowType:
|
|
10384
|
+
flowType: import_browser65.EmbeddedFlowType.UserOnboarding,
|
|
10092
10385
|
verbose: true
|
|
10093
10386
|
};
|
|
10094
10387
|
const rawResponse = await onInitialize(payload);
|
|
@@ -10253,7 +10546,7 @@ var InviteUser = ({
|
|
|
10253
10546
|
},
|
|
10254
10547
|
data: {
|
|
10255
10548
|
...payload,
|
|
10256
|
-
flowType:
|
|
10549
|
+
flowType: import_browser66.EmbeddedFlowType.UserOnboarding,
|
|
10257
10550
|
verbose: true
|
|
10258
10551
|
}
|
|
10259
10552
|
});
|
|
@@ -10767,35 +11060,35 @@ Organization5.displayName = "Organization";
|
|
|
10767
11060
|
var Organization_default = Organization5;
|
|
10768
11061
|
|
|
10769
11062
|
// src/components/presentation/UserProfile/BaseUserProfile.tsx
|
|
10770
|
-
var
|
|
11063
|
+
var import_browser72 = require("@asgardeo/browser");
|
|
10771
11064
|
var import_css51 = require("@emotion/css");
|
|
10772
11065
|
var import_react76 = require("react");
|
|
10773
11066
|
|
|
10774
11067
|
// src/utils/getMappedUserProfileValue.ts
|
|
10775
|
-
var
|
|
11068
|
+
var import_browser67 = require("@asgardeo/browser");
|
|
10776
11069
|
var getMappedUserProfileValue = (key, mappings, user) => {
|
|
10777
11070
|
if (!key || !mappings || !user) {
|
|
10778
11071
|
return void 0;
|
|
10779
11072
|
}
|
|
10780
11073
|
const mapping = mappings[key];
|
|
10781
11074
|
if (!mapping) {
|
|
10782
|
-
return (0,
|
|
11075
|
+
return (0, import_browser67.get)(user, key);
|
|
10783
11076
|
}
|
|
10784
11077
|
if (Array.isArray(mapping)) {
|
|
10785
11078
|
for (const path of mapping) {
|
|
10786
|
-
const value = (0,
|
|
11079
|
+
const value = (0, import_browser67.get)(user, path);
|
|
10787
11080
|
if (value !== void 0 && value !== null && value !== "") {
|
|
10788
11081
|
return value;
|
|
10789
11082
|
}
|
|
10790
11083
|
}
|
|
10791
11084
|
return void 0;
|
|
10792
11085
|
}
|
|
10793
|
-
return (0,
|
|
11086
|
+
return (0, import_browser67.get)(user, mapping);
|
|
10794
11087
|
};
|
|
10795
11088
|
var getMappedUserProfileValue_default = getMappedUserProfileValue;
|
|
10796
11089
|
|
|
10797
11090
|
// src/components/primitives/Avatar/Avatar.tsx
|
|
10798
|
-
var
|
|
11091
|
+
var import_browser68 = require("@asgardeo/browser");
|
|
10799
11092
|
var import_css45 = require("@emotion/css");
|
|
10800
11093
|
var import_react69 = require("react");
|
|
10801
11094
|
|
|
@@ -10914,20 +11207,20 @@ var Avatar = ({
|
|
|
10914
11207
|
const getInitials = (fullName) => fullName.split(" ").map((part) => part[0]).slice(0, 2).join("").toUpperCase();
|
|
10915
11208
|
const renderContent = () => {
|
|
10916
11209
|
if (imageUrl) {
|
|
10917
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: imageUrl, alt, className: (0, import_css45.cx)((0,
|
|
11210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("img", { src: imageUrl, alt, className: (0, import_css45.cx)((0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar", "image")), styles.image) });
|
|
10918
11211
|
}
|
|
10919
11212
|
if (name) {
|
|
10920
11213
|
return getInitials(name);
|
|
10921
11214
|
}
|
|
10922
11215
|
if (isLoading) {
|
|
10923
|
-
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: (0, import_css45.cx)((0,
|
|
11216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: (0, import_css45.cx)((0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar", "skeleton")), styles.skeleton) });
|
|
10924
11217
|
}
|
|
10925
11218
|
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
10926
11219
|
"svg",
|
|
10927
11220
|
{
|
|
10928
11221
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10929
11222
|
viewBox: "0 0 640 640",
|
|
10930
|
-
className: (0, import_css45.cx)((0,
|
|
11223
|
+
className: (0, import_css45.cx)((0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar", "icon")), styles.icon),
|
|
10931
11224
|
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("path", { d: "M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z" })
|
|
10932
11225
|
}
|
|
10933
11226
|
);
|
|
@@ -10936,11 +11229,11 @@ var Avatar = ({
|
|
|
10936
11229
|
"div",
|
|
10937
11230
|
{
|
|
10938
11231
|
className: (0, import_css45.cx)(
|
|
10939
|
-
(0,
|
|
11232
|
+
(0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar")),
|
|
10940
11233
|
styles.avatar,
|
|
10941
11234
|
styles.variant,
|
|
10942
|
-
(0,
|
|
10943
|
-
isDefaultState && (0,
|
|
11235
|
+
(0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar", null, variant)),
|
|
11236
|
+
isDefaultState && (0, import_browser68.withVendorCSSClassPrefix)((0, import_browser68.bem)("avatar", "default")),
|
|
10944
11237
|
className
|
|
10945
11238
|
),
|
|
10946
11239
|
children: renderContent()
|
|
@@ -10950,7 +11243,7 @@ var Avatar = ({
|
|
|
10950
11243
|
var Avatar_default = Avatar;
|
|
10951
11244
|
|
|
10952
11245
|
// src/components/primitives/Dialog/Dialog.tsx
|
|
10953
|
-
var
|
|
11246
|
+
var import_browser69 = require("@asgardeo/browser");
|
|
10954
11247
|
var import_react71 = require("@floating-ui/react");
|
|
10955
11248
|
var import_css47 = require("@emotion/css");
|
|
10956
11249
|
var import_react72 = __toESM(require("react"), 1);
|
|
@@ -11187,11 +11480,11 @@ var DialogContent = import_react72.default.forwardRef((props, propRef) => {
|
|
|
11187
11480
|
const styles = Dialog_styles_default(theme, colorScheme);
|
|
11188
11481
|
const ref = (0, import_react71.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
11189
11482
|
if (!floatingContext.open) return null;
|
|
11190
|
-
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react71.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react71.FloatingOverlay, { className: (0, import_css47.cx)((0,
|
|
11483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react71.FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react71.FloatingOverlay, { className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "overlay")), styles.overlay), lockScroll: true, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_react71.FloatingFocusManager, { context: floatingContext, initialFocus: -1, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11191
11484
|
"div",
|
|
11192
11485
|
{
|
|
11193
11486
|
ref,
|
|
11194
|
-
className: (0, import_css47.cx)((0,
|
|
11487
|
+
className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "content")), styles.content, props.className),
|
|
11195
11488
|
"aria-labelledby": context.labelId,
|
|
11196
11489
|
"aria-describedby": context.descriptionId,
|
|
11197
11490
|
...context.getFloatingProps(props),
|
|
@@ -11209,14 +11502,14 @@ var DialogHeading = import_react72.default.forwardRef(
|
|
|
11209
11502
|
context.setLabelId(id);
|
|
11210
11503
|
return () => context.setLabelId(void 0);
|
|
11211
11504
|
}, [id, context.setLabelId]);
|
|
11212
|
-
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: (0, import_css47.cx)((0,
|
|
11505
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsxs)("div", { className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "header")), styles.header), children: [
|
|
11213
11506
|
/* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
11214
11507
|
"h2",
|
|
11215
11508
|
{
|
|
11216
11509
|
...props,
|
|
11217
11510
|
ref,
|
|
11218
11511
|
id,
|
|
11219
|
-
className: (0, import_css47.cx)((0,
|
|
11512
|
+
className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "title")), styles.headerTitle),
|
|
11220
11513
|
children
|
|
11221
11514
|
}
|
|
11222
11515
|
),
|
|
@@ -11251,7 +11544,7 @@ var DialogDescription = import_react72.default.forwardRef(
|
|
|
11251
11544
|
...props,
|
|
11252
11545
|
ref,
|
|
11253
11546
|
id,
|
|
11254
|
-
className: (0, import_css47.cx)((0,
|
|
11547
|
+
className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "description")), styles.description, props.className),
|
|
11255
11548
|
children
|
|
11256
11549
|
}
|
|
11257
11550
|
);
|
|
@@ -11281,7 +11574,7 @@ var DialogClose = import_react72.default.forwardRef(({ children, asChild = false
|
|
|
11281
11574
|
...props,
|
|
11282
11575
|
ref,
|
|
11283
11576
|
onClick: handleClick,
|
|
11284
|
-
className: (0, import_css47.cx)((0,
|
|
11577
|
+
className: (0, import_css47.cx)((0, import_browser69.withVendorCSSClassPrefix)((0, import_browser69.bem)("dialog", "close")), props.className),
|
|
11285
11578
|
variant: "text",
|
|
11286
11579
|
children
|
|
11287
11580
|
}
|
|
@@ -11302,7 +11595,7 @@ var Dialog_default = Dialog;
|
|
|
11302
11595
|
// src/components/primitives/MultiInput/MultiInput.tsx
|
|
11303
11596
|
var import_react74 = require("react");
|
|
11304
11597
|
var import_css49 = require("@emotion/css");
|
|
11305
|
-
var
|
|
11598
|
+
var import_browser70 = require("@asgardeo/browser");
|
|
11306
11599
|
|
|
11307
11600
|
// src/components/primitives/MultiInput/MultiInput.styles.ts
|
|
11308
11601
|
var import_css48 = require("@emotion/css");
|
|
@@ -11494,26 +11787,26 @@ var MultiInput = ({
|
|
|
11494
11787
|
{
|
|
11495
11788
|
error,
|
|
11496
11789
|
helperText,
|
|
11497
|
-
className: (0, import_css49.cx)((0,
|
|
11790
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input")), className),
|
|
11498
11791
|
style,
|
|
11499
11792
|
children: [
|
|
11500
11793
|
label && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(InputLabel_default, { required, error: !!error, children: label }),
|
|
11501
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css49.cx)((0,
|
|
11502
|
-
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css49.cx)((0,
|
|
11794
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "container")), styles.container), children: [
|
|
11795
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "input-row")), styles.inputRow), children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "input-wrapper")), styles.inputWrapper), children: renderInputField(
|
|
11503
11796
|
currentInputValue,
|
|
11504
11797
|
setCurrentInputValue,
|
|
11505
11798
|
canAddMore ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(PlusIcon, { className: styles.plusIcon }) : void 0,
|
|
11506
11799
|
canAddMore ? handleInputSubmit : void 0
|
|
11507
11800
|
) }) }),
|
|
11508
|
-
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css49.cx)((0,
|
|
11801
|
+
values.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "list-container")), styles.listContainer), children: values.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
11509
11802
|
"div",
|
|
11510
11803
|
{
|
|
11511
|
-
className: (0, import_css49.cx)((0,
|
|
11804
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "list-item")), styles.listItem),
|
|
11512
11805
|
children: [
|
|
11513
11806
|
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
11514
11807
|
"span",
|
|
11515
11808
|
{
|
|
11516
|
-
className: (0, import_css49.cx)((0,
|
|
11809
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "list-item-text")), styles.listItemText),
|
|
11517
11810
|
children: value
|
|
11518
11811
|
}
|
|
11519
11812
|
),
|
|
@@ -11523,7 +11816,7 @@ var MultiInput = ({
|
|
|
11523
11816
|
type: "button",
|
|
11524
11817
|
onClick: () => handleRemoveValue(index),
|
|
11525
11818
|
disabled,
|
|
11526
|
-
className: (0, import_css49.cx)((0,
|
|
11819
|
+
className: (0, import_css49.cx)((0, import_browser70.withVendorCSSClassPrefix)((0, import_browser70.bem)("multi-input", "remove-button")), styles.removeButton),
|
|
11527
11820
|
title: "Remove value",
|
|
11528
11821
|
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(BinIcon, { className: styles.icon })
|
|
11529
11822
|
}
|
|
@@ -11542,7 +11835,7 @@ var MultiInput_default = MultiInput;
|
|
|
11542
11835
|
// src/components/presentation/UserProfile/BaseUserProfile.styles.ts
|
|
11543
11836
|
var import_css50 = require("@emotion/css");
|
|
11544
11837
|
var import_react75 = require("react");
|
|
11545
|
-
var
|
|
11838
|
+
var import_browser71 = require("@asgardeo/browser");
|
|
11546
11839
|
var useStyles23 = (theme, colorScheme) => {
|
|
11547
11840
|
const valuePlaceholder = import_css50.css`
|
|
11548
11841
|
font-style: italic;
|
|
@@ -11653,7 +11946,7 @@ var useStyles23 = (theme, colorScheme) => {
|
|
|
11653
11946
|
max-width: 350px;
|
|
11654
11947
|
text-align: start;
|
|
11655
11948
|
|
|
11656
|
-
.${(0,
|
|
11949
|
+
.${(0, import_browser71.withVendorCSSClassPrefix)("form-control")} {
|
|
11657
11950
|
margin-bottom: 0;
|
|
11658
11951
|
}
|
|
11659
11952
|
|
|
@@ -11852,7 +12145,7 @@ var BaseUserProfile = ({
|
|
|
11852
12145
|
fieldValue = fieldValue.filter((v) => v !== void 0 && v !== null && v !== "");
|
|
11853
12146
|
}
|
|
11854
12147
|
let payload = {};
|
|
11855
|
-
if (schema.schemaId && schema.schemaId !==
|
|
12148
|
+
if (schema.schemaId && schema.schemaId !== import_browser72.WellKnownSchemaIds.User) {
|
|
11856
12149
|
payload = {
|
|
11857
12150
|
[schema.schemaId]: {
|
|
11858
12151
|
[fieldName]: fieldValue
|
|
@@ -12086,7 +12379,7 @@ var BaseUserProfile = ({
|
|
|
12086
12379
|
const containerClasses = (0, import_css51.cx)(
|
|
12087
12380
|
styles.root,
|
|
12088
12381
|
cardLayout ? styles.card : "",
|
|
12089
|
-
(0,
|
|
12382
|
+
(0, import_browser72.withVendorCSSClassPrefix)("user-profile"),
|
|
12090
12383
|
className
|
|
12091
12384
|
);
|
|
12092
12385
|
const currentUser = flattenedProfile || profile;
|
|
@@ -12104,7 +12397,7 @@ var BaseUserProfile = ({
|
|
|
12104
12397
|
] }, key)) });
|
|
12105
12398
|
};
|
|
12106
12399
|
const profileContent = /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Card_default, { className: containerClasses, children: [
|
|
12107
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Alert_default, { variant: "error", className: (0, import_css51.cx)((0,
|
|
12400
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(Alert_default, { variant: "error", className: (0, import_css51.cx)((0, import_browser72.withVendorCSSClassPrefix)((0, import_browser72.bem)("user-profile", "alert")), styles.alert), children: [
|
|
12108
12401
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Alert_default.Title, { children: t("errors.heading") || "Error" }),
|
|
12109
12402
|
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)(Alert_default.Description, { children: error })
|
|
12110
12403
|
] }),
|
|
@@ -12152,8 +12445,8 @@ var BaseUserProfile_default = BaseUserProfile;
|
|
|
12152
12445
|
var import_react77 = require("react");
|
|
12153
12446
|
|
|
12154
12447
|
// src/api/updateMeProfile.ts
|
|
12155
|
-
var
|
|
12156
|
-
var httpClient5 =
|
|
12448
|
+
var import_browser73 = require("@asgardeo/browser");
|
|
12449
|
+
var httpClient5 = import_browser73.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser73.AsgardeoSPAClient.getInstance());
|
|
12157
12450
|
var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
12158
12451
|
const defaultFetcher = async (url, config) => {
|
|
12159
12452
|
const response = await httpClient5({
|
|
@@ -12170,7 +12463,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
12170
12463
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
12171
12464
|
};
|
|
12172
12465
|
};
|
|
12173
|
-
return (0,
|
|
12466
|
+
return (0, import_browser73.updateMeProfile)({
|
|
12174
12467
|
...requestConfig,
|
|
12175
12468
|
fetcher: fetcher || defaultFetcher
|
|
12176
12469
|
});
|
|
@@ -12178,7 +12471,7 @@ var updateMeProfile = async ({ fetcher, ...requestConfig }) => {
|
|
|
12178
12471
|
var updateMeProfile_default = updateMeProfile;
|
|
12179
12472
|
|
|
12180
12473
|
// src/components/presentation/UserProfile/UserProfile.tsx
|
|
12181
|
-
var
|
|
12474
|
+
var import_browser74 = require("@asgardeo/browser");
|
|
12182
12475
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
12183
12476
|
var UserProfile3 = ({ ...rest }) => {
|
|
12184
12477
|
const { baseUrl, isLoading } = useAsgardeo_default();
|
|
@@ -12192,7 +12485,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
12192
12485
|
onUpdateProfile(response);
|
|
12193
12486
|
} catch (error2) {
|
|
12194
12487
|
let message = t("user.profile.update.generic.error");
|
|
12195
|
-
if (error2 instanceof
|
|
12488
|
+
if (error2 instanceof import_browser74.AsgardeoError) {
|
|
12196
12489
|
message = error2?.message;
|
|
12197
12490
|
}
|
|
12198
12491
|
setError(message);
|
|
@@ -12213,7 +12506,7 @@ var UserProfile3 = ({ ...rest }) => {
|
|
|
12213
12506
|
var UserProfile_default = UserProfile3;
|
|
12214
12507
|
|
|
12215
12508
|
// src/components/presentation/UserDropdown/BaseUserDropdown.tsx
|
|
12216
|
-
var
|
|
12509
|
+
var import_browser75 = require("@asgardeo/browser");
|
|
12217
12510
|
var import_react79 = require("@floating-ui/react");
|
|
12218
12511
|
var import_css53 = require("@emotion/css");
|
|
12219
12512
|
var import_react80 = require("react");
|
|
@@ -12474,12 +12767,12 @@ var BaseUserDropdown = ({
|
|
|
12474
12767
|
}
|
|
12475
12768
|
allMenuItems.push(...defaultMenuItems);
|
|
12476
12769
|
}
|
|
12477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0,
|
|
12770
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown"), className), children: [
|
|
12478
12771
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12479
12772
|
Button_default,
|
|
12480
12773
|
{
|
|
12481
12774
|
ref: refs.setReference,
|
|
12482
|
-
className: (0, import_css53.cx)((0,
|
|
12775
|
+
className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__trigger"), styles.trigger),
|
|
12483
12776
|
color: "tertiary",
|
|
12484
12777
|
variant: "text",
|
|
12485
12778
|
size: "medium",
|
|
@@ -12498,7 +12791,7 @@ var BaseUserDropdown = ({
|
|
|
12498
12791
|
Typography_default,
|
|
12499
12792
|
{
|
|
12500
12793
|
variant: "body2",
|
|
12501
|
-
className: (0, import_css53.cx)((0,
|
|
12794
|
+
className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__trigger-label"), styles.userName),
|
|
12502
12795
|
children: getDisplayName_default(mergedMappings, user)
|
|
12503
12796
|
}
|
|
12504
12797
|
)
|
|
@@ -12509,7 +12802,7 @@ var BaseUserDropdown = ({
|
|
|
12509
12802
|
"div",
|
|
12510
12803
|
{
|
|
12511
12804
|
ref: refs.setFloating,
|
|
12512
|
-
className: (0, import_css53.cx)((0,
|
|
12805
|
+
className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__content"), styles.dropdownContent),
|
|
12513
12806
|
style: {
|
|
12514
12807
|
...floatingStyles,
|
|
12515
12808
|
// Floating UI doesn't set a z-index by default, so we set a high value to ensure the dropdown appears above other elements.
|
|
@@ -12518,7 +12811,7 @@ var BaseUserDropdown = ({
|
|
|
12518
12811
|
},
|
|
12519
12812
|
...getFloatingProps(),
|
|
12520
12813
|
children: [
|
|
12521
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0,
|
|
12814
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__header"), styles.dropdownHeader), children: [
|
|
12522
12815
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12523
12816
|
Avatar,
|
|
12524
12817
|
{
|
|
@@ -12528,12 +12821,12 @@ var BaseUserDropdown = ({
|
|
|
12528
12821
|
alt: `${getDisplayName_default(mergedMappings, user)}'s avatar`
|
|
12529
12822
|
}
|
|
12530
12823
|
),
|
|
12531
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0,
|
|
12824
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__header-info"), styles.headerInfo), children: [
|
|
12532
12825
|
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
12533
12826
|
Typography_default,
|
|
12534
12827
|
{
|
|
12535
12828
|
noWrap: true,
|
|
12536
|
-
className: (0,
|
|
12829
|
+
className: (0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__header-name"),
|
|
12537
12830
|
variant: "body1",
|
|
12538
12831
|
fontWeight: "medium",
|
|
12539
12832
|
children: getDisplayName_default(mergedMappings, user)
|
|
@@ -12543,7 +12836,7 @@ var BaseUserDropdown = ({
|
|
|
12543
12836
|
Typography_default,
|
|
12544
12837
|
{
|
|
12545
12838
|
noWrap: true,
|
|
12546
|
-
className: (0,
|
|
12839
|
+
className: (0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__header-email"),
|
|
12547
12840
|
variant: "caption",
|
|
12548
12841
|
color: "secondary",
|
|
12549
12842
|
children: getMappedUserProfileValue_default("username", mergedMappings, user) || getMappedUserProfileValue_default("email", mergedMappings, user)
|
|
@@ -12551,14 +12844,14 @@ var BaseUserDropdown = ({
|
|
|
12551
12844
|
)
|
|
12552
12845
|
] })
|
|
12553
12846
|
] }),
|
|
12554
|
-
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css53.cx)((0,
|
|
12847
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__menu"), styles.dropdownMenu), children: allMenuItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: item.label === "" ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__menu-divider"), styles.divider) }) : item.href ? /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
|
|
12555
12848
|
"a",
|
|
12556
12849
|
{
|
|
12557
12850
|
href: item.href,
|
|
12558
12851
|
style: {
|
|
12559
12852
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
12560
12853
|
},
|
|
12561
|
-
className: (0, import_css53.cx)((0,
|
|
12854
|
+
className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItemAnchor),
|
|
12562
12855
|
onMouseEnter: () => setHoveredItemIndex(index),
|
|
12563
12856
|
onMouseLeave: () => setHoveredItemIndex(null),
|
|
12564
12857
|
onFocus: () => setHoveredItemIndex(index),
|
|
@@ -12575,7 +12868,7 @@ var BaseUserDropdown = ({
|
|
|
12575
12868
|
style: {
|
|
12576
12869
|
backgroundColor: hoveredItemIndex === index ? theme.vars.colors.action?.hover : "transparent"
|
|
12577
12870
|
},
|
|
12578
|
-
className: (0, import_css53.cx)((0,
|
|
12871
|
+
className: (0, import_css53.cx)((0, import_browser75.withVendorCSSClassPrefix)("user-dropdown__menu-item"), styles.menuItem),
|
|
12579
12872
|
color: "tertiary",
|
|
12580
12873
|
variant: "text",
|
|
12581
12874
|
size: "small",
|
|
@@ -13478,8 +13771,8 @@ var BaseCreateOrganization = ({
|
|
|
13478
13771
|
};
|
|
13479
13772
|
|
|
13480
13773
|
// src/api/createOrganization.ts
|
|
13481
|
-
var
|
|
13482
|
-
var httpClient6 =
|
|
13774
|
+
var import_browser76 = require("@asgardeo/browser");
|
|
13775
|
+
var httpClient6 = import_browser76.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser76.AsgardeoSPAClient.getInstance());
|
|
13483
13776
|
var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
13484
13777
|
const defaultFetcher = async (url, config) => {
|
|
13485
13778
|
const response = await httpClient6({
|
|
@@ -13496,7 +13789,7 @@ var createOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
13496
13789
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
13497
13790
|
};
|
|
13498
13791
|
};
|
|
13499
|
-
return (0,
|
|
13792
|
+
return (0, import_browser76.createOrganization)({
|
|
13500
13793
|
...requestConfig,
|
|
13501
13794
|
fetcher: fetcher || defaultFetcher
|
|
13502
13795
|
});
|
|
@@ -13571,12 +13864,12 @@ var CreateOrganization = ({
|
|
|
13571
13864
|
var import_react92 = require("react");
|
|
13572
13865
|
|
|
13573
13866
|
// src/components/presentation/OrganizationProfile/BaseOrganizationProfile.tsx
|
|
13574
|
-
var
|
|
13867
|
+
var import_browser78 = require("@asgardeo/browser");
|
|
13575
13868
|
var import_css61 = require("@emotion/css");
|
|
13576
13869
|
var import_react91 = require("react");
|
|
13577
13870
|
|
|
13578
13871
|
// src/components/primitives/KeyValueInput/KeyValueInput.tsx
|
|
13579
|
-
var
|
|
13872
|
+
var import_browser77 = require("@asgardeo/browser");
|
|
13580
13873
|
var import_css59 = require("@emotion/css");
|
|
13581
13874
|
var import_react89 = require("react");
|
|
13582
13875
|
|
|
@@ -13811,27 +14104,27 @@ var KeyValueInput = ({
|
|
|
13811
14104
|
);
|
|
13812
14105
|
const canAddMore = !maxPairs || pairs.length < maxPairs;
|
|
13813
14106
|
const isAddDisabled = disabled || readOnly || !canAddMore || !newKey.trim() || !newValue.trim();
|
|
13814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0,
|
|
13815
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("label", { className: (0, import_css59.cx)((0,
|
|
14107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input")), styles.container, className), children: [
|
|
14108
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("label", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "label")), styles.label), children: [
|
|
13816
14109
|
label,
|
|
13817
14110
|
required && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
13818
14111
|
"span",
|
|
13819
14112
|
{
|
|
13820
|
-
className: (0, import_css59.cx)((0,
|
|
14113
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "required")), styles.requiredIndicator),
|
|
13821
14114
|
children: " *"
|
|
13822
14115
|
}
|
|
13823
14116
|
)
|
|
13824
14117
|
] }),
|
|
13825
|
-
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0,
|
|
13826
|
-
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: (0, import_css59.cx)((0,
|
|
14118
|
+
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pairs-list")), styles.pairsList), children: [
|
|
14119
|
+
pairs.length === 0 && readOnly ? /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "empty-state")), styles.emptyState), children: "No attributes defined" }) : readOnly ? pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
13827
14120
|
"div",
|
|
13828
14121
|
{
|
|
13829
|
-
className: (0, import_css59.cx)((0,
|
|
14122
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "readonly-pair")), styles.readOnlyPair),
|
|
13830
14123
|
children: [
|
|
13831
14124
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
13832
14125
|
"span",
|
|
13833
14126
|
{
|
|
13834
|
-
className: (0, import_css59.cx)((0,
|
|
14127
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "readonly-key")), styles.readOnlyKey),
|
|
13835
14128
|
children: [
|
|
13836
14129
|
pair.key,
|
|
13837
14130
|
":"
|
|
@@ -13841,7 +14134,7 @@ var KeyValueInput = ({
|
|
|
13841
14134
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
13842
14135
|
"span",
|
|
13843
14136
|
{
|
|
13844
|
-
className: (0, import_css59.cx)((0,
|
|
14137
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "readonly-value")), styles.readOnlyValue),
|
|
13845
14138
|
children: pair.value
|
|
13846
14139
|
}
|
|
13847
14140
|
)
|
|
@@ -13851,7 +14144,7 @@ var KeyValueInput = ({
|
|
|
13851
14144
|
)) : pairs.map((pair, index) => /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)(
|
|
13852
14145
|
"div",
|
|
13853
14146
|
{
|
|
13854
|
-
className: (0, import_css59.cx)((0,
|
|
14147
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pair-row")), styles.pairRow),
|
|
13855
14148
|
children: [
|
|
13856
14149
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
13857
14150
|
TextField_default,
|
|
@@ -13860,7 +14153,7 @@ var KeyValueInput = ({
|
|
|
13860
14153
|
value: pair.key,
|
|
13861
14154
|
onChange: (e) => handleUpdatePair(index, "key", e.target.value),
|
|
13862
14155
|
disabled: disabled || readOnly,
|
|
13863
|
-
className: (0, import_css59.cx)((0,
|
|
14156
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
13864
14157
|
"aria-label": `${keyLabel} ${index + 1}`
|
|
13865
14158
|
}
|
|
13866
14159
|
),
|
|
@@ -13871,7 +14164,7 @@ var KeyValueInput = ({
|
|
|
13871
14164
|
value: pair.value,
|
|
13872
14165
|
onChange: (e) => handleUpdatePair(index, "value", e.target.value),
|
|
13873
14166
|
disabled: disabled || readOnly,
|
|
13874
|
-
className: (0, import_css59.cx)((0,
|
|
14167
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
13875
14168
|
"aria-label": `${valueLabel} ${index + 1}`
|
|
13876
14169
|
}
|
|
13877
14170
|
),
|
|
@@ -13881,7 +14174,7 @@ var KeyValueInput = ({
|
|
|
13881
14174
|
type: "button",
|
|
13882
14175
|
onClick: () => handleRemovePair(index),
|
|
13883
14176
|
disabled,
|
|
13884
|
-
className: (0, import_css59.cx)((0,
|
|
14177
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "remove-button")), styles.removeButton),
|
|
13885
14178
|
"aria-label": `${removeButtonText} ${pair.key}`,
|
|
13886
14179
|
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(X_default, { width: 16, height: 16 })
|
|
13887
14180
|
}
|
|
@@ -13890,7 +14183,7 @@ var KeyValueInput = ({
|
|
|
13890
14183
|
},
|
|
13891
14184
|
`${pair.key}-${index}`
|
|
13892
14185
|
)),
|
|
13893
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0,
|
|
14186
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "add-row")), styles.addRow), children: [
|
|
13894
14187
|
/* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
|
|
13895
14188
|
TextField_default,
|
|
13896
14189
|
{
|
|
@@ -13898,7 +14191,7 @@ var KeyValueInput = ({
|
|
|
13898
14191
|
value: newKey,
|
|
13899
14192
|
onChange: (e) => setNewKey(e.target.value),
|
|
13900
14193
|
disabled,
|
|
13901
|
-
className: (0, import_css59.cx)((0,
|
|
14194
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
13902
14195
|
"aria-label": "New key"
|
|
13903
14196
|
}
|
|
13904
14197
|
),
|
|
@@ -13909,7 +14202,7 @@ var KeyValueInput = ({
|
|
|
13909
14202
|
value: newValue,
|
|
13910
14203
|
onChange: (e) => setNewValue(e.target.value),
|
|
13911
14204
|
disabled,
|
|
13912
|
-
className: (0, import_css59.cx)((0,
|
|
14205
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "pair-input")), styles.pairInput),
|
|
13913
14206
|
"aria-label": "New value",
|
|
13914
14207
|
onKeyPress: (e) => {
|
|
13915
14208
|
if (e.key === "Enter" && !isAddDisabled) {
|
|
@@ -13924,15 +14217,15 @@ var KeyValueInput = ({
|
|
|
13924
14217
|
type: "button",
|
|
13925
14218
|
onClick: handleAddPair,
|
|
13926
14219
|
disabled: isAddDisabled,
|
|
13927
|
-
className: (0, import_css59.cx)((0,
|
|
14220
|
+
className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "add-button")), styles.addButton),
|
|
13928
14221
|
"aria-label": "Add new key-value pair",
|
|
13929
14222
|
children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(Plus_default, { width: 16, height: 16 })
|
|
13930
14223
|
}
|
|
13931
14224
|
)
|
|
13932
14225
|
] })
|
|
13933
14226
|
] }),
|
|
13934
|
-
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: (0, import_css59.cx)((0,
|
|
13935
|
-
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0,
|
|
14227
|
+
(helperText || error) && /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "helper-text")), styles.helperText), children: error || helperText }),
|
|
14228
|
+
maxPairs && /* @__PURE__ */ (0, import_jsx_runtime98.jsxs)("div", { className: (0, import_css59.cx)((0, import_browser77.withVendorCSSClassPrefix)((0, import_browser77.bem)("key-value-input", "counter")), styles.counterText), children: [
|
|
13936
14229
|
pairs.length,
|
|
13937
14230
|
" of ",
|
|
13938
14231
|
maxPairs,
|
|
@@ -14136,13 +14429,13 @@ var BaseOrganizationProfile = ({
|
|
|
14136
14429
|
key: "created",
|
|
14137
14430
|
label: "Created Date",
|
|
14138
14431
|
editable: false,
|
|
14139
|
-
render: (value) => (0,
|
|
14432
|
+
render: (value) => (0, import_browser78.formatDate)(value)
|
|
14140
14433
|
},
|
|
14141
14434
|
{
|
|
14142
14435
|
key: "lastModified",
|
|
14143
14436
|
label: "Last Modified Date",
|
|
14144
14437
|
editable: false,
|
|
14145
|
-
render: (value) => (0,
|
|
14438
|
+
render: (value) => (0, import_browser78.formatDate)(value)
|
|
14146
14439
|
}
|
|
14147
14440
|
]
|
|
14148
14441
|
}) => {
|
|
@@ -14379,8 +14672,8 @@ var BaseOrganizationProfile = ({
|
|
|
14379
14672
|
var BaseOrganizationProfile_default = BaseOrganizationProfile;
|
|
14380
14673
|
|
|
14381
14674
|
// src/api/getOrganization.ts
|
|
14382
|
-
var
|
|
14383
|
-
var httpClient7 =
|
|
14675
|
+
var import_browser79 = require("@asgardeo/browser");
|
|
14676
|
+
var httpClient7 = import_browser79.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser79.AsgardeoSPAClient.getInstance());
|
|
14384
14677
|
var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
14385
14678
|
const defaultFetcher = async (url, config) => {
|
|
14386
14679
|
const response = await httpClient7({
|
|
@@ -14396,7 +14689,7 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
14396
14689
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
14397
14690
|
};
|
|
14398
14691
|
};
|
|
14399
|
-
return (0,
|
|
14692
|
+
return (0, import_browser79.getOrganization)({
|
|
14400
14693
|
...requestConfig,
|
|
14401
14694
|
fetcher: fetcher || defaultFetcher
|
|
14402
14695
|
});
|
|
@@ -14404,8 +14697,8 @@ var getOrganization = async ({ fetcher, ...requestConfig }) => {
|
|
|
14404
14697
|
var getOrganization_default = getOrganization;
|
|
14405
14698
|
|
|
14406
14699
|
// src/api/updateOrganization.ts
|
|
14407
|
-
var
|
|
14408
|
-
var httpClient8 =
|
|
14700
|
+
var import_browser80 = require("@asgardeo/browser");
|
|
14701
|
+
var httpClient8 = import_browser80.AsgardeoSPAClient.getInstance().httpRequest.bind(import_browser80.AsgardeoSPAClient.getInstance());
|
|
14409
14702
|
var updateOrganization = async ({
|
|
14410
14703
|
fetcher,
|
|
14411
14704
|
...requestConfig
|
|
@@ -14425,7 +14718,7 @@ var updateOrganization = async ({
|
|
|
14425
14718
|
text: () => Promise.resolve(typeof response.data === "string" ? response.data : JSON.stringify(response.data))
|
|
14426
14719
|
};
|
|
14427
14720
|
};
|
|
14428
|
-
return (0,
|
|
14721
|
+
return (0, import_browser80.updateOrganization)({
|
|
14429
14722
|
...requestConfig,
|
|
14430
14723
|
fetcher: fetcher || defaultFetcher
|
|
14431
14724
|
});
|
|
@@ -14478,7 +14771,7 @@ var OrganizationProfile = ({
|
|
|
14478
14771
|
const handleOrganizationUpdate = async (payload) => {
|
|
14479
14772
|
if (!baseUrl || !organizationId) return;
|
|
14480
14773
|
try {
|
|
14481
|
-
const operations = (0,
|
|
14774
|
+
const operations = (0, import_browser80.createPatchOperations)(payload);
|
|
14482
14775
|
await updateOrganization_default({
|
|
14483
14776
|
baseUrl,
|
|
14484
14777
|
organizationId,
|
|
@@ -15128,5 +15421,5 @@ var OrganizationSwitcher = ({
|
|
|
15128
15421
|
var OrganizationSwitcher_default = OrganizationSwitcher;
|
|
15129
15422
|
|
|
15130
15423
|
// src/index.ts
|
|
15131
|
-
var
|
|
15424
|
+
var import_browser81 = require("@asgardeo/browser");
|
|
15132
15425
|
//# sourceMappingURL=index.js.map
|