@drmhse/authos-vue 0.1.3 → 0.1.5
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 +242 -149
- package/dist/{chunk-OGRUDANK.mjs → chunk-YED35B36.mjs} +6 -1
- package/dist/index.d.mts +393 -5
- package/dist/index.d.ts +393 -5
- package/dist/index.js +372 -9
- package/dist/index.mjs +361 -11
- package/dist/nuxt.js +6 -1
- package/dist/nuxt.mjs +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import { App, PropType, VNode } from 'vue';
|
|
2
|
+
import { App, ComputedRef, PropType, VNode } from 'vue';
|
|
3
3
|
import * as _drmhse_sso_sdk from '@drmhse/sso-sdk';
|
|
4
4
|
import { TokenStorage, UserProfile, OrganizationResponse, SsoClient } from '@drmhse/sso-sdk';
|
|
5
5
|
export { AuthErrorCodes, BrowserStorage, MemoryStorage, OrganizationResponse, SsoApiError, SsoClient, TokenStorage, UserProfile } from '@drmhse/sso-sdk';
|
|
@@ -14,10 +14,67 @@ interface AuthOSState {
|
|
|
14
14
|
interface AuthOSContext {
|
|
15
15
|
client: SsoClient;
|
|
16
16
|
state: AuthOSState;
|
|
17
|
+
/** The plugin configuration options */
|
|
18
|
+
options: AuthOSPluginOptions;
|
|
17
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* Configuration options for the AuthOS Vue plugin.
|
|
22
|
+
*
|
|
23
|
+
* Supports two modes:
|
|
24
|
+
* - **Platform-level**: Just `baseURL` for platform owners/admins (email/password only)
|
|
25
|
+
* - **Multi-tenant**: With `org` and `service` for tenant apps (enables OAuth)
|
|
26
|
+
*
|
|
27
|
+
* @example Platform-level access
|
|
28
|
+
* ```ts
|
|
29
|
+
* app.use(createAuthOS({
|
|
30
|
+
* baseURL: 'https://sso.example.com',
|
|
31
|
+
* }));
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Multi-tenant with OAuth
|
|
35
|
+
* ```ts
|
|
36
|
+
* app.use(createAuthOS({
|
|
37
|
+
* baseURL: 'https://sso.example.com',
|
|
38
|
+
* org: 'my-org',
|
|
39
|
+
* service: 'my-app',
|
|
40
|
+
* }));
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
18
43
|
interface AuthOSPluginOptions {
|
|
19
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Base URL of the AuthOS API service.
|
|
46
|
+
* @example 'https://sso.example.com'
|
|
47
|
+
*/
|
|
48
|
+
baseURL: string;
|
|
49
|
+
/**
|
|
50
|
+
* Organization slug for OAuth flows.
|
|
51
|
+
* Only required when using OAuth login buttons.
|
|
52
|
+
* Omit for platform-level access.
|
|
53
|
+
* @example 'acme-corp'
|
|
54
|
+
*/
|
|
55
|
+
org?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Service slug for OAuth flows.
|
|
58
|
+
* Only required when using OAuth login buttons.
|
|
59
|
+
* Omit for platform-level access.
|
|
60
|
+
* @example 'main-app'
|
|
61
|
+
*/
|
|
62
|
+
service?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Redirect URI after OAuth authentication.
|
|
65
|
+
* Defaults to current window location origin + '/callback'.
|
|
66
|
+
* @example 'https://app.example.com/callback'
|
|
67
|
+
*/
|
|
68
|
+
redirectUri?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Custom storage provider (optional).
|
|
71
|
+
* Defaults to localStorage in browser, Memory in SSR.
|
|
72
|
+
*/
|
|
20
73
|
storage?: TokenStorage;
|
|
74
|
+
/**
|
|
75
|
+
* Automatically refresh expired tokens.
|
|
76
|
+
* @default true
|
|
77
|
+
*/
|
|
21
78
|
autoRefresh?: boolean;
|
|
22
79
|
/**
|
|
23
80
|
* Initial session token from server-side (for SSR hydration).
|
|
@@ -25,15 +82,46 @@ interface AuthOSPluginOptions {
|
|
|
25
82
|
* Typically passed from cookies in Nuxt server components.
|
|
26
83
|
*/
|
|
27
84
|
initialToken?: string;
|
|
85
|
+
/**
|
|
86
|
+
* URL to redirect to after successful sign-in.
|
|
87
|
+
* @example '/dashboard'
|
|
88
|
+
*/
|
|
89
|
+
afterSignInUrl?: string;
|
|
90
|
+
/**
|
|
91
|
+
* URL to redirect to after successful sign-up.
|
|
92
|
+
* @example '/onboarding'
|
|
93
|
+
*/
|
|
94
|
+
afterSignUpUrl?: string;
|
|
28
95
|
}
|
|
29
96
|
declare const AUTH_OS_INJECTION_KEY: unique symbol;
|
|
97
|
+
/**
|
|
98
|
+
* Supported OAuth providers
|
|
99
|
+
*/
|
|
100
|
+
type SupportedOAuthProvider = 'github' | 'google' | 'microsoft';
|
|
30
101
|
|
|
31
102
|
declare function createAuthOS(options: AuthOSPluginOptions): {
|
|
32
103
|
install(app: App): void;
|
|
33
104
|
};
|
|
34
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Access the AuthOS client, state, and configuration.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```vue
|
|
111
|
+
* <script setup>
|
|
112
|
+
* import { useAuthOS } from '@drmhse/authos-vue';
|
|
113
|
+
*
|
|
114
|
+
* const { client, isAuthenticated, isLoading, options } = useAuthOS();
|
|
115
|
+
*
|
|
116
|
+
* async function handleLogout() {
|
|
117
|
+
* await client.auth.logout();
|
|
118
|
+
* }
|
|
119
|
+
* </script>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
35
122
|
declare function useAuthOS(): {
|
|
36
123
|
client: SsoClient;
|
|
124
|
+
options: AuthOSPluginOptions;
|
|
37
125
|
isLoading: vue.ComputedRef<boolean>;
|
|
38
126
|
isAuthenticated: vue.ComputedRef<boolean>;
|
|
39
127
|
};
|
|
@@ -46,6 +134,24 @@ declare function useUser(): {
|
|
|
46
134
|
isLoading: vue.ComputedRef<boolean>;
|
|
47
135
|
};
|
|
48
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Composable to access the current organization context and switch between organizations.
|
|
139
|
+
*
|
|
140
|
+
* When switching organizations, this calls the backend to issue new JWT tokens
|
|
141
|
+
* with the organization context, enabling seamless organization switching without
|
|
142
|
+
* requiring re-authentication.
|
|
143
|
+
*
|
|
144
|
+
* @returns The current organization and a function to switch organizations
|
|
145
|
+
*
|
|
146
|
+
* @example
|
|
147
|
+
* ```vue
|
|
148
|
+
* <script setup>
|
|
149
|
+
* import { useOrganization } from '@drmhse/authos-vue';
|
|
150
|
+
*
|
|
151
|
+
* const { currentOrganization, switchOrganization, isSwitching } = useOrganization();
|
|
152
|
+
* </script>
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
49
155
|
declare function useOrganization(): {
|
|
50
156
|
currentOrganization: vue.Ref<null, null>;
|
|
51
157
|
organizations: vue.Ref<never[], never[]>;
|
|
@@ -58,11 +164,76 @@ declare function useOrganization(): {
|
|
|
58
164
|
isSwitching: vue.Ref<boolean, boolean>;
|
|
59
165
|
};
|
|
60
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Check if the current user has a specific permission.
|
|
169
|
+
*
|
|
170
|
+
* @param permission The permission to check
|
|
171
|
+
* @returns A computed ref that is true if the user has the permission
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```vue
|
|
175
|
+
* <script setup>
|
|
176
|
+
* import { usePermission } from '@drmhse/authos-vue';
|
|
177
|
+
*
|
|
178
|
+
* const canAccessAdmin = usePermission('admin:access');
|
|
179
|
+
* </script>
|
|
180
|
+
*
|
|
181
|
+
* <template>
|
|
182
|
+
* <button v-if="canAccessAdmin">Admin Panel</button>
|
|
183
|
+
* </template>
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
declare function usePermission(permission: string): ComputedRef<boolean>;
|
|
187
|
+
/**
|
|
188
|
+
* Check if the current user has any of the specified permissions.
|
|
189
|
+
*
|
|
190
|
+
* @param permissions The permissions to check
|
|
191
|
+
* @returns A computed ref that is true if the user has any of the permissions
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```vue
|
|
195
|
+
* <script setup>
|
|
196
|
+
* import { useAnyPermission } from '@drmhse/authos-vue';
|
|
197
|
+
*
|
|
198
|
+
* const canAccessReports = useAnyPermission(['reports:read', 'admin:access']);
|
|
199
|
+
* </script>
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
declare function useAnyPermission(permissions: string[]): ComputedRef<boolean>;
|
|
203
|
+
/**
|
|
204
|
+
* Check if the current user has all of the specified permissions.
|
|
205
|
+
*
|
|
206
|
+
* @param permissions The permissions to check
|
|
207
|
+
* @returns A computed ref that is true if the user has all of the permissions
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```vue
|
|
211
|
+
* <script setup>
|
|
212
|
+
* import { useAllPermissions } from '@drmhse/authos-vue';
|
|
213
|
+
*
|
|
214
|
+
* const canManageBilling = useAllPermissions(['billing:read', 'billing:write']);
|
|
215
|
+
* </script>
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
declare function useAllPermissions(permissions: string[]): ComputedRef<boolean>;
|
|
219
|
+
|
|
61
220
|
declare const AuthOSProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
62
|
-
|
|
221
|
+
baseURL: {
|
|
63
222
|
type: StringConstructor;
|
|
64
223
|
required: true;
|
|
65
224
|
};
|
|
225
|
+
org: {
|
|
226
|
+
type: StringConstructor;
|
|
227
|
+
default: undefined;
|
|
228
|
+
};
|
|
229
|
+
service: {
|
|
230
|
+
type: StringConstructor;
|
|
231
|
+
default: undefined;
|
|
232
|
+
};
|
|
233
|
+
redirectUri: {
|
|
234
|
+
type: StringConstructor;
|
|
235
|
+
default: undefined;
|
|
236
|
+
};
|
|
66
237
|
storage: {
|
|
67
238
|
type: PropType<TokenStorage>;
|
|
68
239
|
default: undefined;
|
|
@@ -76,10 +247,22 @@ declare const AuthOSProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
76
247
|
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
77
248
|
[key: string]: any;
|
|
78
249
|
}>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
79
|
-
|
|
250
|
+
baseURL: {
|
|
80
251
|
type: StringConstructor;
|
|
81
252
|
required: true;
|
|
82
253
|
};
|
|
254
|
+
org: {
|
|
255
|
+
type: StringConstructor;
|
|
256
|
+
default: undefined;
|
|
257
|
+
};
|
|
258
|
+
service: {
|
|
259
|
+
type: StringConstructor;
|
|
260
|
+
default: undefined;
|
|
261
|
+
};
|
|
262
|
+
redirectUri: {
|
|
263
|
+
type: StringConstructor;
|
|
264
|
+
default: undefined;
|
|
265
|
+
};
|
|
83
266
|
storage: {
|
|
84
267
|
type: PropType<TokenStorage>;
|
|
85
268
|
default: undefined;
|
|
@@ -89,6 +272,9 @@ declare const AuthOSProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
89
272
|
default: undefined;
|
|
90
273
|
};
|
|
91
274
|
}>> & Readonly<{}>, {
|
|
275
|
+
org: string;
|
|
276
|
+
service: string;
|
|
277
|
+
redirectUri: string;
|
|
92
278
|
storage: TokenStorage;
|
|
93
279
|
client: SsoClient;
|
|
94
280
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
@@ -154,6 +340,16 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
154
340
|
type: PropType<(error: Error) => void>;
|
|
155
341
|
default: undefined;
|
|
156
342
|
};
|
|
343
|
+
/** Organization slug for tenant context */
|
|
344
|
+
orgSlug: {
|
|
345
|
+
type: StringConstructor;
|
|
346
|
+
default: undefined;
|
|
347
|
+
};
|
|
348
|
+
/** Service slug for tenant attribution (used with orgSlug) */
|
|
349
|
+
serviceSlug: {
|
|
350
|
+
type: StringConstructor;
|
|
351
|
+
default: undefined;
|
|
352
|
+
};
|
|
157
353
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
158
354
|
[key: string]: any;
|
|
159
355
|
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
@@ -167,12 +363,24 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
167
363
|
type: PropType<(error: Error) => void>;
|
|
168
364
|
default: undefined;
|
|
169
365
|
};
|
|
366
|
+
/** Organization slug for tenant context */
|
|
367
|
+
orgSlug: {
|
|
368
|
+
type: StringConstructor;
|
|
369
|
+
default: undefined;
|
|
370
|
+
};
|
|
371
|
+
/** Service slug for tenant attribution (used with orgSlug) */
|
|
372
|
+
serviceSlug: {
|
|
373
|
+
type: StringConstructor;
|
|
374
|
+
default: undefined;
|
|
375
|
+
};
|
|
170
376
|
}>> & Readonly<{
|
|
171
377
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
172
378
|
onError?: ((...args: any[]) => any) | undefined;
|
|
173
379
|
}>, {
|
|
174
380
|
onSuccess: () => void;
|
|
175
381
|
onError: (error: Error) => void;
|
|
382
|
+
orgSlug: string;
|
|
383
|
+
serviceSlug: string;
|
|
176
384
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
177
385
|
|
|
178
386
|
interface OrganizationSwitcherSlotProps {
|
|
@@ -272,4 +480,184 @@ declare const Protect: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
272
480
|
}> | (() => VNode);
|
|
273
481
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
274
482
|
|
|
275
|
-
|
|
483
|
+
interface OAuthButtonSlotProps {
|
|
484
|
+
provider: SupportedOAuthProvider;
|
|
485
|
+
providerName: string;
|
|
486
|
+
isConfigured: boolean;
|
|
487
|
+
disabled: boolean;
|
|
488
|
+
handleClick: () => void;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* OAuth login button for a specific provider.
|
|
492
|
+
* Redirects the user to the OAuth provider's login page.
|
|
493
|
+
*
|
|
494
|
+
* Requires `org` and `service` to be configured in createAuthOS options.
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* ```vue
|
|
498
|
+
* <script setup>
|
|
499
|
+
* import { OAuthButton } from '@drmhse/authos-vue';
|
|
500
|
+
* </script>
|
|
501
|
+
*
|
|
502
|
+
* <template>
|
|
503
|
+
* <OAuthButton provider="github" />
|
|
504
|
+
* <OAuthButton provider="google">Sign in with Google</OAuthButton>
|
|
505
|
+
* </template>
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
|
+
declare const OAuthButton: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
509
|
+
provider: {
|
|
510
|
+
type: PropType<SupportedOAuthProvider>;
|
|
511
|
+
required: true;
|
|
512
|
+
};
|
|
513
|
+
disabled: {
|
|
514
|
+
type: BooleanConstructor;
|
|
515
|
+
default: boolean;
|
|
516
|
+
};
|
|
517
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
518
|
+
[key: string]: any;
|
|
519
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
520
|
+
[key: string]: any;
|
|
521
|
+
}>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "redirect"[], "redirect", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
522
|
+
provider: {
|
|
523
|
+
type: PropType<SupportedOAuthProvider>;
|
|
524
|
+
required: true;
|
|
525
|
+
};
|
|
526
|
+
disabled: {
|
|
527
|
+
type: BooleanConstructor;
|
|
528
|
+
default: boolean;
|
|
529
|
+
};
|
|
530
|
+
}>> & Readonly<{
|
|
531
|
+
onRedirect?: ((...args: any[]) => any) | undefined;
|
|
532
|
+
}>, {
|
|
533
|
+
disabled: boolean;
|
|
534
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* Renders children only when the user is authenticated.
|
|
538
|
+
* Use with SignedOut to create conditional UI based on auth state.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```vue
|
|
542
|
+
* <script setup>
|
|
543
|
+
* import { SignedIn, SignedOut, UserButton, SignIn } from '@drmhse/authos-vue';
|
|
544
|
+
* </script>
|
|
545
|
+
*
|
|
546
|
+
* <template>
|
|
547
|
+
* <header>
|
|
548
|
+
* <SignedIn>
|
|
549
|
+
* <UserButton />
|
|
550
|
+
* </SignedIn>
|
|
551
|
+
* <SignedOut>
|
|
552
|
+
* <SignIn />
|
|
553
|
+
* </SignedOut>
|
|
554
|
+
* </header>
|
|
555
|
+
* </template>
|
|
556
|
+
* ```
|
|
557
|
+
*/
|
|
558
|
+
declare const SignedIn: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
559
|
+
[key: string]: any;
|
|
560
|
+
}>[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Renders children only when the user is NOT authenticated.
|
|
564
|
+
* Use with SignedIn to create conditional UI based on auth state.
|
|
565
|
+
*
|
|
566
|
+
* @example
|
|
567
|
+
* ```vue
|
|
568
|
+
* <script setup>
|
|
569
|
+
* import { SignedIn, SignedOut, UserButton, SignIn } from '@drmhse/authos-vue';
|
|
570
|
+
* </script>
|
|
571
|
+
*
|
|
572
|
+
* <template>
|
|
573
|
+
* <header>
|
|
574
|
+
* <SignedIn>
|
|
575
|
+
* <UserButton />
|
|
576
|
+
* </SignedIn>
|
|
577
|
+
* <SignedOut>
|
|
578
|
+
* <SignIn />
|
|
579
|
+
* </SignedOut>
|
|
580
|
+
* </header>
|
|
581
|
+
* </template>
|
|
582
|
+
* ```
|
|
583
|
+
*/
|
|
584
|
+
declare const SignedOut: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
585
|
+
[key: string]: any;
|
|
586
|
+
}>[] | null | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Passwordless sign-in via magic link (email).
|
|
590
|
+
*
|
|
591
|
+
* Sends a one-time login link to the user's email address.
|
|
592
|
+
*
|
|
593
|
+
* @example
|
|
594
|
+
* ```vue
|
|
595
|
+
* <script setup>
|
|
596
|
+
* import { MagicLinkSignIn } from '@drmhse/authos-vue';
|
|
597
|
+
* </script>
|
|
598
|
+
*
|
|
599
|
+
* <template>
|
|
600
|
+
* <MagicLinkSignIn @success="() => alert('Check your email!')" />
|
|
601
|
+
* </template>
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
declare const MagicLinkSignIn: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
605
|
+
showPasswordSignIn: {
|
|
606
|
+
type: BooleanConstructor;
|
|
607
|
+
default: boolean;
|
|
608
|
+
};
|
|
609
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
610
|
+
[key: string]: any;
|
|
611
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
612
|
+
[key: string]: any;
|
|
613
|
+
}>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error")[], "success" | "error", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
614
|
+
showPasswordSignIn: {
|
|
615
|
+
type: BooleanConstructor;
|
|
616
|
+
default: boolean;
|
|
617
|
+
};
|
|
618
|
+
}>> & Readonly<{
|
|
619
|
+
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
620
|
+
onError?: ((...args: any[]) => any) | undefined;
|
|
621
|
+
}>, {
|
|
622
|
+
showPasswordSignIn: boolean;
|
|
623
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* Passkey (WebAuthn) sign-in component.
|
|
627
|
+
*
|
|
628
|
+
* Uses the Web Authentication API for passwordless authentication
|
|
629
|
+
* via biometrics, security keys, or platform authenticators.
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* ```vue
|
|
633
|
+
* <script setup>
|
|
634
|
+
* import { PasskeySignIn } from '@drmhse/authos-vue';
|
|
635
|
+
* </script>
|
|
636
|
+
*
|
|
637
|
+
* <template>
|
|
638
|
+
* <PasskeySignIn @success="() => router.push('/dashboard')" />
|
|
639
|
+
* </template>
|
|
640
|
+
* ```
|
|
641
|
+
*/
|
|
642
|
+
declare const PasskeySignIn: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
643
|
+
showPasswordSignIn: {
|
|
644
|
+
type: BooleanConstructor;
|
|
645
|
+
default: boolean;
|
|
646
|
+
};
|
|
647
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
648
|
+
[key: string]: any;
|
|
649
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
650
|
+
[key: string]: any;
|
|
651
|
+
}>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error")[], "success" | "error", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
652
|
+
showPasswordSignIn: {
|
|
653
|
+
type: BooleanConstructor;
|
|
654
|
+
default: boolean;
|
|
655
|
+
};
|
|
656
|
+
}>> & Readonly<{
|
|
657
|
+
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
658
|
+
onError?: ((...args: any[]) => any) | undefined;
|
|
659
|
+
}>, {
|
|
660
|
+
showPasswordSignIn: boolean;
|
|
661
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
662
|
+
|
|
663
|
+
export { AUTH_OS_INJECTION_KEY, type AuthOSContext, type AuthOSPluginOptions, AuthOSProvider, type AuthOSState, MagicLinkSignIn, OAuthButton, type OAuthButtonSlotProps, OrganizationSwitcher, type OrganizationSwitcherSlotProps, PasskeySignIn, Protect, SignIn, type SignInSlotProps, SignUp, type SignUpSlotProps, SignedIn, SignedOut, type SupportedOAuthProvider, UserButton, type UserButtonSlotProps, createAuthOS, useAllPermissions, useAnyPermission, useAuthOS, useOrganization, usePermission, useUser };
|