@asgardeo/vue 0.0.10 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -1
- package/dist/AsgardeoVueClient.d.ts +64 -0
- package/dist/__temp__/api.d.ts +63 -0
- package/dist/__temp__/models.d.ts +43 -0
- package/dist/api/getAllOrganizations.d.ts +24 -0
- package/dist/api/getMeOrganizations.d.ts +24 -0
- package/dist/api/getSchemas.d.ts +24 -0
- package/dist/api/getScim2Me.d.ts +24 -0
- package/dist/cjs/index.js +10849 -1578
- package/dist/cjs/index.js.map +7 -1
- package/dist/components/actions/BaseSignInButton.d.ts +34 -0
- package/dist/components/actions/BaseSignOutButton.d.ts +34 -0
- package/dist/components/actions/BaseSignUpButton.d.ts +34 -0
- package/dist/components/actions/SignInButton.d.ts +26 -0
- package/dist/components/actions/SignOutButton.d.ts +23 -0
- package/dist/components/actions/SignUpButton.d.ts +26 -0
- package/dist/{cjs/types/vitest.config.d.ts → components/adapters/FacebookButton.d.ts} +7 -2
- package/dist/components/adapters/GitHubButton.d.ts +24 -0
- package/dist/components/adapters/GoogleButton.d.ts +24 -0
- package/dist/components/adapters/MicrosoftButton.d.ts +24 -0
- package/dist/components/auth/Callback.d.ts +31 -0
- package/dist/components/control/Loading.d.ts +33 -0
- package/dist/components/control/SignedIn.d.ts +33 -0
- package/dist/components/control/SignedOut.d.ts +33 -0
- package/dist/components/control/organization/Organization.d.ts +38 -0
- package/dist/components/control/user/User.d.ts +38 -0
- package/dist/components/factories/FieldFactory.d.ts +51 -0
- package/dist/components/presentation/accept-invite/AcceptInvite.d.ts +28 -0
- package/dist/components/presentation/accept-invite/BaseAcceptInvite.d.ts +82 -0
- package/dist/{esm/types/composables/useAsgardeo.d.ts → components/presentation/create-organization/BaseCreateOrganization.d.ts} +5 -4
- package/dist/components/presentation/create-organization/CreateOrganization.css.d.ts +34 -0
- package/dist/components/presentation/create-organization/CreateOrganization.d.ts +25 -0
- package/dist/components/presentation/invite-user/BaseInviteUser.d.ts +80 -0
- package/dist/components/presentation/invite-user/InviteUser.d.ts +25 -0
- package/dist/components/presentation/language-switcher/BaseLanguageSwitcher.d.ts +25 -0
- package/dist/components/presentation/language-switcher/LanguageSwitcher.css.d.ts +36 -0
- package/dist/components/presentation/language-switcher/LanguageSwitcher.d.ts +25 -0
- package/dist/components/presentation/organization-list/BaseOrganizationList.d.ts +23 -0
- package/dist/components/presentation/organization-list/OrganizationList.css.d.ts +32 -0
- package/dist/{cjs/types/composables/useAsgardeo.d.ts → components/presentation/organization-list/OrganizationList.d.ts} +5 -4
- package/dist/{cjs/types/composables/useAsgardeoContext.d.ts → components/presentation/organization-profile/BaseOrganizationProfile.d.ts} +6 -5
- package/dist/components/presentation/organization-profile/OrganizationProfile.css.d.ts +24 -0
- package/dist/components/presentation/organization-profile/OrganizationProfile.d.ts +25 -0
- package/dist/components/presentation/organization-switcher/BaseOrganizationSwitcher.d.ts +25 -0
- package/dist/components/presentation/organization-switcher/OrganizationSwitcher.css.d.ts +39 -0
- package/dist/components/presentation/organization-switcher/OrganizationSwitcher.d.ts +25 -0
- package/dist/components/presentation/sign-in/AuthOptionFactory.d.ts +18 -0
- package/dist/components/presentation/sign-in/AuthOptionFactoryCore.d.ts +68 -0
- package/dist/components/presentation/sign-in/BaseSignIn.d.ts +27 -0
- package/dist/components/presentation/sign-in/SignIn.d.ts +27 -0
- package/dist/components/presentation/sign-in/v1/BaseSignIn.d.ts +26 -0
- package/dist/components/presentation/sign-in/v1/SignIn.d.ts +26 -0
- package/dist/components/presentation/sign-in/v1/options/SignInOptionFactory.d.ts +46 -0
- package/dist/components/presentation/sign-in/v2/AuthOptionFactory.d.ts +18 -0
- package/dist/components/presentation/sign-in/v2/BaseSignIn.d.ts +82 -0
- package/dist/components/presentation/sign-in/v2/SignIn.d.ts +55 -0
- package/dist/components/presentation/sign-up/BaseSignUp.d.ts +72 -0
- package/dist/components/presentation/sign-up/SignUp.d.ts +25 -0
- package/dist/components/presentation/user-dropdown/BaseUserDropdown.d.ts +33 -0
- package/dist/components/presentation/user-dropdown/UserDropdown.css.d.ts +35 -0
- package/dist/components/presentation/user-dropdown/UserDropdown.d.ts +25 -0
- package/dist/components/presentation/user-profile/BaseUserProfile.d.ts +47 -0
- package/dist/components/presentation/user-profile/UserProfile.css.d.ts +24 -0
- package/dist/{esm/types/public-api.d.ts → components/presentation/user-profile/UserProfile.d.ts} +3 -2
- package/dist/components/primitives/Alert/Alert.css.d.ts +30 -0
- package/dist/{cjs/types/public-api.d.ts → components/primitives/Alert/Alert.d.ts} +3 -2
- package/dist/components/primitives/Alert/index.d.ts +18 -0
- package/dist/components/primitives/Button/Button.css.d.ts +36 -0
- package/dist/components/primitives/Button/Button.d.ts +20 -0
- package/dist/components/primitives/Button/index.d.ts +18 -0
- package/dist/components/primitives/Card/Card.css.d.ts +29 -0
- package/dist/{esm/types/index.d.ts → components/primitives/Card/Card.d.ts} +3 -3
- package/dist/components/primitives/Card/index.d.ts +18 -0
- package/dist/components/primitives/Checkbox/Checkbox.css.d.ts +30 -0
- package/dist/components/primitives/Checkbox/Checkbox.d.ts +20 -0
- package/dist/components/primitives/Checkbox/index.d.ts +18 -0
- package/dist/components/primitives/DatePicker/DatePicker.css.d.ts +30 -0
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +20 -0
- package/dist/components/primitives/DatePicker/index.d.ts +18 -0
- package/dist/components/primitives/Divider/Divider.css.d.ts +32 -0
- package/dist/components/primitives/Divider/Divider.d.ts +20 -0
- package/dist/components/primitives/Divider/index.d.ts +18 -0
- package/dist/components/primitives/Icons.d.ts +34 -0
- package/dist/components/primitives/Logo/Logo.css.d.ts +27 -0
- package/dist/{cjs/types/index.d.ts → components/primitives/Logo/Logo.d.ts} +3 -3
- package/dist/components/primitives/Logo/index.d.ts +18 -0
- package/dist/{cjs/types/plugins/AsgardeoPlugin.d.ts → components/primitives/OtpField/OtpField.css.d.ts} +10 -5
- package/dist/components/primitives/OtpField/OtpField.d.ts +20 -0
- package/dist/components/primitives/OtpField/index.d.ts +18 -0
- package/dist/components/primitives/PasswordField/PasswordField.css.d.ts +30 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts +20 -0
- package/dist/components/primitives/PasswordField/index.d.ts +18 -0
- package/dist/components/primitives/Select/Select.css.d.ts +30 -0
- package/dist/components/primitives/Select/Select.d.ts +25 -0
- package/dist/components/primitives/Select/index.d.ts +18 -0
- package/dist/{esm/types/composables/useAsgardeoContext.d.ts → components/primitives/Spinner/Spinner.css.d.ts} +13 -5
- package/dist/components/primitives/Spinner/Spinner.d.ts +20 -0
- package/dist/components/primitives/Spinner/index.d.ts +18 -0
- package/dist/components/primitives/TextField/TextField.css.d.ts +30 -0
- package/dist/components/primitives/TextField/TextField.d.ts +20 -0
- package/dist/components/primitives/TextField/index.d.ts +18 -0
- package/dist/components/primitives/Typography/Typography.css.d.ts +30 -0
- package/dist/components/primitives/Typography/Typography.d.ts +20 -0
- package/dist/components/primitives/Typography/index.d.ts +18 -0
- package/dist/composables/useAsgardeo.d.ts +48 -0
- package/dist/composables/useBranding.d.ts +43 -0
- package/dist/composables/useFlow.d.ts +45 -0
- package/dist/composables/useFlowMeta.d.ts +41 -0
- package/dist/composables/useI18n.d.ts +45 -0
- package/dist/composables/useOAuthCallback.d.ts +65 -0
- package/dist/composables/useOrganization.d.ts +41 -0
- package/dist/composables/useTheme.d.ts +43 -0
- package/dist/composables/useUser.d.ts +44 -0
- package/dist/index.d.ts +103 -141
- package/dist/index.js +11073 -0
- package/dist/index.js.map +7 -0
- package/dist/keys.d.ts +51 -0
- package/dist/models/config.d.ts +19 -0
- package/dist/models/contexts.d.ts +244 -0
- package/dist/{esm/types/plugins → plugins}/AsgardeoPlugin.d.ts +28 -4
- package/dist/providers/AsgardeoProvider.d.ts +35 -0
- package/dist/providers/BrandingProvider.d.ts +29 -0
- package/dist/providers/FlowMetaProvider.d.ts +20 -0
- package/dist/providers/FlowProvider.d.ts +20 -0
- package/dist/providers/I18nProvider.d.ts +20 -0
- package/dist/providers/OrganizationProvider.d.ts +20 -0
- package/dist/providers/ThemeProvider.d.ts +20 -0
- package/dist/providers/UserProvider.d.ts +20 -0
- package/dist/router/callbackRoute.d.ts +87 -0
- package/dist/router/guard.d.ts +96 -0
- package/dist/styles/animations.css.d.ts +28 -0
- package/dist/styles/defaults.css.d.ts +31 -0
- package/dist/styles/injectStyles.d.ts +23 -0
- package/dist/theme/getActiveTheme.d.ts +28 -0
- package/dist/theme/themeDetection.d.ts +30 -0
- package/dist/utils/handleWebAuthnAuthentication.d.ts +27 -0
- package/dist/utils/hasAuthParamsInUrl.d.ts +26 -0
- package/dist/utils/http.d.ts +26 -0
- package/dist/utils/logger.d.ts +30 -0
- package/dist/utils/navigate.d.ts +27 -0
- package/dist/utils/oauth.d.ts +24 -0
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts +28 -0
- package/dist/utils/v2/flowTransformer.d.ts +96 -0
- package/dist/utils/v2/getAuthComponentHeadings.d.ts +40 -0
- package/dist/utils/v2/passkey.d.ts +31 -0
- package/dist/utils/v2/resolveTranslationsInArray.d.ts +29 -0
- package/dist/utils/v2/resolveTranslationsInObject.d.ts +29 -0
- package/package.json +54 -68
- package/dist/cjs/types/auth-api.d.ts +0 -237
- package/dist/cjs/types/tests/mocks/mocks.d.ts +0 -57
- package/dist/cjs/types/types.d.ts +0 -107
- package/dist/esm/index.js +0 -1600
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/auth-api.d.ts +0 -237
- package/dist/esm/types/tests/mocks/mocks.d.ts +0 -57
- package/dist/esm/types/types.d.ts +0 -107
- package/dist/esm/types/vitest.config.d.ts +0 -19
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import type { InjectionKey } from 'vue';
|
|
19
|
+
import type { AsgardeoContext, BrandingContextValue, FlowContextValue, FlowMetaContextValue, I18nContextValue, OrganizationContextValue, ThemeContextValue, UserContextValue } from './models/contexts';
|
|
20
|
+
/**
|
|
21
|
+
* Injection key for the core Asgardeo authentication context.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ASGARDEO_KEY: InjectionKey<AsgardeoContext>;
|
|
24
|
+
/**
|
|
25
|
+
* Injection key for the User context (profile, schemas, update operations).
|
|
26
|
+
*/
|
|
27
|
+
export declare const USER_KEY: InjectionKey<UserContextValue>;
|
|
28
|
+
/**
|
|
29
|
+
* Injection key for the Organization context (list, current org, switching).
|
|
30
|
+
*/
|
|
31
|
+
export declare const ORGANIZATION_KEY: InjectionKey<OrganizationContextValue>;
|
|
32
|
+
/**
|
|
33
|
+
* Injection key for the Flow context (embedded flow UI state).
|
|
34
|
+
*/
|
|
35
|
+
export declare const FLOW_KEY: InjectionKey<FlowContextValue>;
|
|
36
|
+
/**
|
|
37
|
+
* Injection key for the FlowMeta context (server-driven flow metadata).
|
|
38
|
+
*/
|
|
39
|
+
export declare const FLOW_META_KEY: InjectionKey<FlowMetaContextValue>;
|
|
40
|
+
/**
|
|
41
|
+
* Injection key for the Theme context (color scheme, CSS variables, toggle).
|
|
42
|
+
*/
|
|
43
|
+
export declare const THEME_KEY: InjectionKey<ThemeContextValue>;
|
|
44
|
+
/**
|
|
45
|
+
* Injection key for the Branding context (branding preferences from server).
|
|
46
|
+
*/
|
|
47
|
+
export declare const BRANDING_KEY: InjectionKey<BrandingContextValue>;
|
|
48
|
+
/**
|
|
49
|
+
* Injection key for the I18n context (translation function, language switching).
|
|
50
|
+
*/
|
|
51
|
+
export declare const I18N_KEY: InjectionKey<I18nContextValue>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { AsgardeoBrowserConfig } from '@asgardeo/browser';
|
|
19
|
+
export type AsgardeoVueConfig = AsgardeoBrowserConfig;
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import type { AllOrganizationsApiResponse, BrandingPreference, CreateOrganizationPayload, FlowMetadataResponse, HttpRequestConfig, HttpResponse, IdToken, Organization, Schema, SignInOptions, Theme, TokenExchangeRequestConfig, TokenResponse, UpdateMeProfileConfig, User, UserProfile } from '@asgardeo/browser';
|
|
19
|
+
import type { I18nBundle } from '@asgardeo/i18n';
|
|
20
|
+
import type { Ref } from 'vue';
|
|
21
|
+
import type { AsgardeoVueConfig } from './config';
|
|
22
|
+
import type AsgardeoVueClient from '../AsgardeoVueClient';
|
|
23
|
+
/**
|
|
24
|
+
* Shape of the core Asgardeo context provided via `provide`/`inject`.
|
|
25
|
+
*
|
|
26
|
+
* Reactive refs are exposed as `Readonly<Ref<T>>` so consumers can read
|
|
27
|
+
* them in templates and `watch()` calls but cannot mutate them directly.
|
|
28
|
+
*/
|
|
29
|
+
export interface AsgardeoContext {
|
|
30
|
+
/** The `afterSignInUrl` from the config. */
|
|
31
|
+
afterSignInUrl: string | undefined;
|
|
32
|
+
/** The Asgardeo application ID from the config. */
|
|
33
|
+
applicationId: string | undefined;
|
|
34
|
+
/** The base URL of the Asgardeo tenant. */
|
|
35
|
+
baseUrl: string | undefined;
|
|
36
|
+
clearSession: (...args: any[]) => void;
|
|
37
|
+
/** The OAuth2 client ID. */
|
|
38
|
+
clientId: string | undefined;
|
|
39
|
+
exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;
|
|
40
|
+
getAccessToken: () => Promise<string>;
|
|
41
|
+
getDecodedIdToken: () => Promise<IdToken>;
|
|
42
|
+
getIdToken: () => Promise<string>;
|
|
43
|
+
http: {
|
|
44
|
+
request: (requestConfig?: HttpRequestConfig) => Promise<HttpResponse<any>>;
|
|
45
|
+
requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;
|
|
46
|
+
};
|
|
47
|
+
/** The instance ID for multi-instance support. */
|
|
48
|
+
instanceId: number;
|
|
49
|
+
/** Whether the SDK has finished initializing. */
|
|
50
|
+
isInitialized: Readonly<Ref<boolean>>;
|
|
51
|
+
/** Whether the SDK is performing a background operation. */
|
|
52
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
53
|
+
/** Whether the user is currently signed in. */
|
|
54
|
+
isSignedIn: Readonly<Ref<boolean>>;
|
|
55
|
+
/** Flow metadata from the FlowMeta context, or `null` while loading/unavailable. */
|
|
56
|
+
meta?: Readonly<Ref<FlowMetadataResponse | null>>;
|
|
57
|
+
/** The current organization, or `null`. */
|
|
58
|
+
organization: Readonly<Ref<Organization | null>>;
|
|
59
|
+
organizationHandle: string | undefined;
|
|
60
|
+
platform: AsgardeoVueConfig['platform'] | undefined;
|
|
61
|
+
reInitialize: (config: Partial<AsgardeoVueConfig>) => Promise<boolean>;
|
|
62
|
+
/** Resolve `{{t(...)}}` and `{{meta(...)}}` template literals inside a string. */
|
|
63
|
+
resolveFlowTemplateLiterals?: (text: string | undefined) => string;
|
|
64
|
+
signIn: (...args: any[]) => Promise<any>;
|
|
65
|
+
signInOptions: SignInOptions | undefined;
|
|
66
|
+
signInSilently: (options?: SignInOptions) => Promise<any>;
|
|
67
|
+
signInUrl: string | undefined;
|
|
68
|
+
signOut: (...args: any[]) => Promise<any>;
|
|
69
|
+
signUp: (...args: any[]) => Promise<any>;
|
|
70
|
+
signUpUrl: string | undefined;
|
|
71
|
+
storage: AsgardeoVueConfig['storage'] | undefined;
|
|
72
|
+
switchOrganization: AsgardeoVueClient['switchOrganization'];
|
|
73
|
+
/** The current user object, or `null` if not signed in. */
|
|
74
|
+
user: Readonly<Ref<any | null>>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Shape of the User context exposed by `useUser()`.
|
|
78
|
+
*/
|
|
79
|
+
export interface UserContextValue {
|
|
80
|
+
/** The flattened user profile (top-level attribute map). */
|
|
81
|
+
flattenedProfile: Readonly<Ref<User | null>>;
|
|
82
|
+
/** The raw nested user profile from the SCIM2/ME endpoint. */
|
|
83
|
+
profile: Readonly<Ref<UserProfile | null>>;
|
|
84
|
+
/** Refetch the user profile from the server. */
|
|
85
|
+
revalidateProfile: () => Promise<void>;
|
|
86
|
+
/** The SCIM2 schemas describing the user profile attributes. */
|
|
87
|
+
schemas: Readonly<Ref<Schema[] | null>>;
|
|
88
|
+
/**
|
|
89
|
+
* Update the user profile. Accepts the standard SCIM2 patch request config.
|
|
90
|
+
*/
|
|
91
|
+
updateProfile: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
|
|
92
|
+
data: {
|
|
93
|
+
user: User;
|
|
94
|
+
};
|
|
95
|
+
error: string;
|
|
96
|
+
success: boolean;
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Shape of the Organization context exposed by `useOrganization()`.
|
|
101
|
+
*/
|
|
102
|
+
export interface OrganizationContextValue {
|
|
103
|
+
/** Optional function to create a new sub-organization. */
|
|
104
|
+
createOrganization?: (payload: CreateOrganizationPayload, sessionId: string) => Promise<Organization>;
|
|
105
|
+
/** The organization the user is currently operating in. */
|
|
106
|
+
currentOrganization: Readonly<Ref<Organization | null>>;
|
|
107
|
+
/** Last error message from an organization operation, if any. */
|
|
108
|
+
error: Readonly<Ref<string | null>>;
|
|
109
|
+
/** Fetch all organizations (paginated). */
|
|
110
|
+
getAllOrganizations: () => Promise<AllOrganizationsApiResponse>;
|
|
111
|
+
/** Whether an organization operation is in-flight. */
|
|
112
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
113
|
+
/** The list of organizations the signed-in user is a member of. */
|
|
114
|
+
myOrganizations: Readonly<Ref<Organization[]>>;
|
|
115
|
+
/** Re-fetch the user's organization list from the server. */
|
|
116
|
+
revalidateMyOrganizations: () => Promise<Organization[]>;
|
|
117
|
+
/** Switch to the given organization (performs token exchange). */
|
|
118
|
+
switchOrganization: (organization: Organization) => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Types of authentication flow steps that can be displayed.
|
|
122
|
+
*/
|
|
123
|
+
export type FlowStep = {
|
|
124
|
+
canGoBack?: boolean;
|
|
125
|
+
id: string;
|
|
126
|
+
metadata?: Record<string, any>;
|
|
127
|
+
subtitle?: string;
|
|
128
|
+
title: string;
|
|
129
|
+
type: 'signin' | 'signup' | 'organization-signin' | 'forgot-password' | 'reset-password' | 'verify-email' | 'mfa';
|
|
130
|
+
} | null;
|
|
131
|
+
/**
|
|
132
|
+
* A message that can be displayed inside an authentication flow UI.
|
|
133
|
+
*/
|
|
134
|
+
export interface FlowMessage {
|
|
135
|
+
dismissible?: boolean;
|
|
136
|
+
id?: string;
|
|
137
|
+
message: string;
|
|
138
|
+
type: 'success' | 'error' | 'warning' | 'info';
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Shape of the Flow context exposed by `useFlow()`.
|
|
142
|
+
*/
|
|
143
|
+
export interface FlowContextValue {
|
|
144
|
+
addMessage: (message: FlowMessage) => void;
|
|
145
|
+
clearMessages: () => void;
|
|
146
|
+
currentStep: Readonly<Ref<FlowStep>>;
|
|
147
|
+
error: Readonly<Ref<string | null>>;
|
|
148
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
149
|
+
messages: Readonly<Ref<FlowMessage[]>>;
|
|
150
|
+
navigateToFlow: (flowType: NonNullable<FlowStep>['type'], options?: {
|
|
151
|
+
metadata?: Record<string, any>;
|
|
152
|
+
subtitle?: string;
|
|
153
|
+
title?: string;
|
|
154
|
+
}) => void;
|
|
155
|
+
onGoBack: Readonly<Ref<(() => void) | undefined>>;
|
|
156
|
+
removeMessage: (messageId: string) => void;
|
|
157
|
+
reset: () => void;
|
|
158
|
+
setCurrentStep: (step: FlowStep) => void;
|
|
159
|
+
setError: (error: string | null) => void;
|
|
160
|
+
setIsLoading: (loading: boolean) => void;
|
|
161
|
+
setOnGoBack: (callback?: () => void) => void;
|
|
162
|
+
setShowBackButton: (show: boolean) => void;
|
|
163
|
+
setSubtitle: (subtitle?: string) => void;
|
|
164
|
+
setTitle: (title: string) => void;
|
|
165
|
+
showBackButton: Readonly<Ref<boolean>>;
|
|
166
|
+
subtitle: Readonly<Ref<string | undefined>>;
|
|
167
|
+
title: Readonly<Ref<string>>;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Shape of the FlowMeta context exposed by `useFlowMeta()`.
|
|
171
|
+
*/
|
|
172
|
+
export interface FlowMetaContextValue {
|
|
173
|
+
/** Error from the flow metadata fetch, if any. */
|
|
174
|
+
error: Readonly<Ref<Error | null>>;
|
|
175
|
+
/** Manually re-fetch flow metadata from the server. */
|
|
176
|
+
fetchFlowMeta: () => Promise<void>;
|
|
177
|
+
/** Whether the flow metadata is currently being fetched. */
|
|
178
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
179
|
+
/** The fetched `FlowMetadataResponse`, or `null` while loading or on error. */
|
|
180
|
+
meta: Readonly<Ref<FlowMetadataResponse | null>>;
|
|
181
|
+
/**
|
|
182
|
+
* Fetch flow metadata for the given language and activate it in the i18n system.
|
|
183
|
+
* Use this to switch the UI language at runtime.
|
|
184
|
+
*/
|
|
185
|
+
switchLanguage: (language: string) => Promise<void>;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Shape of the Theme context exposed by `useTheme()`.
|
|
189
|
+
*/
|
|
190
|
+
export interface ThemeContextValue {
|
|
191
|
+
/** Error from the branding theme fetch, if any. */
|
|
192
|
+
brandingError: Readonly<Ref<Error | null>>;
|
|
193
|
+
/** The current color scheme ('light' | 'dark'). */
|
|
194
|
+
colorScheme: Readonly<Ref<'light' | 'dark'>>;
|
|
195
|
+
/** The text direction for the UI. */
|
|
196
|
+
direction: Readonly<Ref<'ltr' | 'rtl'>>;
|
|
197
|
+
/** Whether the theme inherits from Asgardeo branding preferences. */
|
|
198
|
+
inheritFromBranding: boolean;
|
|
199
|
+
/** Whether the branding theme is currently loading. */
|
|
200
|
+
isBrandingLoading: Readonly<Ref<boolean>>;
|
|
201
|
+
/** The resolved Theme object used by all styled components. */
|
|
202
|
+
theme: Readonly<Ref<Theme>>;
|
|
203
|
+
/** Toggle between light and dark mode. */
|
|
204
|
+
toggleTheme: () => void;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Shape of the Branding context exposed by `useBranding()`.
|
|
208
|
+
*/
|
|
209
|
+
export interface BrandingContextValue {
|
|
210
|
+
/** The active theme from the branding preference ('light' | 'dark'), or null. */
|
|
211
|
+
activeTheme: Readonly<Ref<'light' | 'dark' | null>>;
|
|
212
|
+
/** The raw branding preference data from the server. */
|
|
213
|
+
brandingPreference: Readonly<Ref<BrandingPreference | null>>;
|
|
214
|
+
/** Error from the branding fetch, if any. */
|
|
215
|
+
error: Readonly<Ref<Error | null>>;
|
|
216
|
+
/** Trigger a branding preference fetch (deduplicated). */
|
|
217
|
+
fetchBranding: () => Promise<void>;
|
|
218
|
+
/** Whether the branding preference is currently loading. */
|
|
219
|
+
isLoading: Readonly<Ref<boolean>>;
|
|
220
|
+
/** Force a fresh branding preference fetch (bypasses dedup). */
|
|
221
|
+
refetch: () => Promise<void>;
|
|
222
|
+
/** The transformed `Theme` object derived from the branding preference. */
|
|
223
|
+
theme: Readonly<Ref<Theme | null>>;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Shape of the I18n context exposed by `useI18n()`.
|
|
227
|
+
*/
|
|
228
|
+
export interface I18nContextValue {
|
|
229
|
+
/** All available i18n bundles (default + injected + user-provided). */
|
|
230
|
+
bundles: Readonly<Ref<Record<string, I18nBundle>>>;
|
|
231
|
+
/** The current language code (e.g., 'en-US'). */
|
|
232
|
+
currentLanguage: Readonly<Ref<string>>;
|
|
233
|
+
/** The fallback language code. */
|
|
234
|
+
fallbackLanguage: string;
|
|
235
|
+
/**
|
|
236
|
+
* Inject additional bundles into the i18n system (e.g., from flow metadata).
|
|
237
|
+
* Injected bundles take precedence over defaults but are overridden by prop-provided bundles.
|
|
238
|
+
*/
|
|
239
|
+
injectBundles: (bundles: Record<string, I18nBundle>) => void;
|
|
240
|
+
/** Change the current language. */
|
|
241
|
+
setLanguage: (language: string) => void;
|
|
242
|
+
/** Translate a key with optional named parameters. */
|
|
243
|
+
t: (key: string, params?: Record<string, string | number>) => string;
|
|
244
|
+
}
|
|
@@ -16,7 +16,31 @@
|
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
18
|
import type { Plugin } from 'vue';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Vue plugin for Asgardeo authentication.
|
|
21
|
+
*
|
|
22
|
+
* Registers the `<AsgardeoProvider>` component globally so it can be used
|
|
23
|
+
* anywhere in the application without explicit imports.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { createApp } from 'vue';
|
|
28
|
+
* import { AsgardeoPlugin } from '@asgardeo/vue';
|
|
29
|
+
* import App from './App.vue';
|
|
30
|
+
*
|
|
31
|
+
* const app = createApp(App);
|
|
32
|
+
* app.use(AsgardeoPlugin);
|
|
33
|
+
* app.mount('#app');
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* Then in your root component:
|
|
37
|
+
* ```vue
|
|
38
|
+
* <template>
|
|
39
|
+
* <AsgardeoProvider :base-url="baseUrl" :client-id="clientId">
|
|
40
|
+
* <router-view />
|
|
41
|
+
* </AsgardeoProvider>
|
|
42
|
+
* </template>
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
declare const AsgardeoPlugin: Plugin;
|
|
46
|
+
export default AsgardeoPlugin;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
/**
|
|
20
|
+
* Root provider component for the Asgardeo Vue SDK.
|
|
21
|
+
*
|
|
22
|
+
* This component initializes the client, manages authentication state,
|
|
23
|
+
* and provides the Asgardeo context to child components via Vue's provide/inject.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```vue
|
|
27
|
+
* <template>
|
|
28
|
+
* <AsgardeoProvider v-bind="config">
|
|
29
|
+
* <router-view />
|
|
30
|
+
* </AsgardeoProvider>
|
|
31
|
+
* </template>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare const AsgardeoProvider: Component;
|
|
35
|
+
export default AsgardeoProvider;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
/**
|
|
20
|
+
* BrandingProvider manages branding preference state and makes branding data
|
|
21
|
+
* available to child components via `useBranding()`.
|
|
22
|
+
*
|
|
23
|
+
* It receives branding preferences from a parent component (typically
|
|
24
|
+
* `<AsgardeoProvider>`) and transforms them into `Theme` objects.
|
|
25
|
+
*
|
|
26
|
+
* @internal — This provider is mounted automatically by `<AsgardeoProvider>`.
|
|
27
|
+
*/
|
|
28
|
+
declare const BrandingProvider: Component;
|
|
29
|
+
export default BrandingProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const FlowMetaProvider: Component;
|
|
20
|
+
export default FlowMetaProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const FlowProvider: Component;
|
|
20
|
+
export default FlowProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const I18nProvider: Component;
|
|
20
|
+
export default I18nProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const OrganizationProvider: Component;
|
|
20
|
+
export default OrganizationProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const ThemeProvider: Component;
|
|
20
|
+
export default ThemeProvider;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { type Component } from 'vue';
|
|
19
|
+
declare const UserProvider: Component;
|
|
20
|
+
export default UserProvider;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { defineComponent } from 'vue';
|
|
19
|
+
/**
|
|
20
|
+
* Options for creating a callback route.
|
|
21
|
+
*/
|
|
22
|
+
export interface CallbackRouteOptions {
|
|
23
|
+
/**
|
|
24
|
+
* The route name. If not provided, no name is set on the route record.
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Optional error handler called when the OAuth callback encounters an error.
|
|
29
|
+
*/
|
|
30
|
+
onError?: (error: Error) => void;
|
|
31
|
+
/**
|
|
32
|
+
* The URL path for the callback route.
|
|
33
|
+
* @default '/callback'
|
|
34
|
+
*/
|
|
35
|
+
path?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* A minimal route record type compatible with Vue Router's `RouteRecordRaw`.
|
|
39
|
+
*
|
|
40
|
+
* This avoids a hard dependency on `vue-router` while remaining structurally compatible.
|
|
41
|
+
*/
|
|
42
|
+
export interface AsgardeoRouteRecord {
|
|
43
|
+
component: ReturnType<typeof defineComponent>;
|
|
44
|
+
meta?: Record<string, unknown>;
|
|
45
|
+
name?: string;
|
|
46
|
+
path: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a Vue Router route record for the OAuth2 callback.
|
|
50
|
+
*
|
|
51
|
+
* The generated route renders the `<Callback>` component which extracts OAuth parameters
|
|
52
|
+
* (code, state, error) from the URL and redirects the user back to the original path.
|
|
53
|
+
*
|
|
54
|
+
* **Requires `vue-router` as a peer dependency.**
|
|
55
|
+
*
|
|
56
|
+
* @param options - Callback route configuration.
|
|
57
|
+
* @returns A route record compatible with Vue Router's `RouteRecordRaw`.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* import { createRouter, createWebHistory } from 'vue-router';
|
|
62
|
+
* import { createCallbackRoute } from '@asgardeo/vue';
|
|
63
|
+
*
|
|
64
|
+
* const router = createRouter({
|
|
65
|
+
* history: createWebHistory(),
|
|
66
|
+
* routes: [
|
|
67
|
+
* createCallbackRoute({ path: '/callback' }),
|
|
68
|
+
* { path: '/', component: Home },
|
|
69
|
+
* { path: '/dashboard', component: Dashboard },
|
|
70
|
+
* ],
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* // With error handling and Vue Router navigation
|
|
77
|
+
* import { useRouter } from 'vue-router';
|
|
78
|
+
*
|
|
79
|
+
* createCallbackRoute({
|
|
80
|
+
* path: '/auth/callback',
|
|
81
|
+
* name: 'oauth-callback',
|
|
82
|
+
* onError: (error) => console.error('OAuth error:', error),
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export declare const createCallbackRoute: (options?: CallbackRouteOptions) => AsgardeoRouteRecord;
|
|
87
|
+
export default createCallbackRoute;
|