@drmhse/authos-vue 0.1.4 → 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 +20 -4
- package/dist/index.d.mts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +17 -3
- package/dist/index.mjs +17 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,10 +46,10 @@ import { SignIn, SignedIn, SignedOut, UserButton } from '@drmhse/authos-vue';
|
|
|
46
46
|
```
|
|
47
47
|
|
|
48
48
|
That's it. You now have:
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
49
|
+
- Email/password authentication with MFA support
|
|
50
|
+
- Automatic session management
|
|
51
|
+
- User dropdown with logout
|
|
52
|
+
- Conditional rendering based on auth state
|
|
53
53
|
|
|
54
54
|
## Usage Modes
|
|
55
55
|
|
|
@@ -167,6 +167,22 @@ Registration form for new users.
|
|
|
167
167
|
<SignUp @success="console.log('Check your email!')" @error="console.error" />
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
### MagicLinkSignIn
|
|
171
|
+
|
|
172
|
+
Sign-in component for Magic Links (passwordless).
|
|
173
|
+
|
|
174
|
+
```vue
|
|
175
|
+
<MagicLinkSignIn @success="console.log('Magic link sent!')" />
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### PasskeySignIn
|
|
179
|
+
|
|
180
|
+
Sign-in component for Passkeys (WebAuthn).
|
|
181
|
+
|
|
182
|
+
```vue
|
|
183
|
+
<PasskeySignIn @success="console.log('Authenticated!')" />
|
|
184
|
+
```
|
|
185
|
+
|
|
170
186
|
### SignedIn / SignedOut
|
|
171
187
|
|
|
172
188
|
Conditional rendering based on authentication state. Inspired by Clerk's API.
|
package/dist/index.d.mts
CHANGED
|
@@ -340,6 +340,16 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
340
340
|
type: PropType<(error: Error) => void>;
|
|
341
341
|
default: undefined;
|
|
342
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
|
+
};
|
|
343
353
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
344
354
|
[key: string]: any;
|
|
345
355
|
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
@@ -353,12 +363,24 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
353
363
|
type: PropType<(error: Error) => void>;
|
|
354
364
|
default: undefined;
|
|
355
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
|
+
};
|
|
356
376
|
}>> & Readonly<{
|
|
357
377
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
358
378
|
onError?: ((...args: any[]) => any) | undefined;
|
|
359
379
|
}>, {
|
|
360
380
|
onSuccess: () => void;
|
|
361
381
|
onError: (error: Error) => void;
|
|
382
|
+
orgSlug: string;
|
|
383
|
+
serviceSlug: string;
|
|
362
384
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
363
385
|
|
|
364
386
|
interface OrganizationSwitcherSlotProps {
|
package/dist/index.d.ts
CHANGED
|
@@ -340,6 +340,16 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
340
340
|
type: PropType<(error: Error) => void>;
|
|
341
341
|
default: undefined;
|
|
342
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
|
+
};
|
|
343
353
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
344
354
|
[key: string]: any;
|
|
345
355
|
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
@@ -353,12 +363,24 @@ declare const SignUp: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
353
363
|
type: PropType<(error: Error) => void>;
|
|
354
364
|
default: undefined;
|
|
355
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
|
+
};
|
|
356
376
|
}>> & Readonly<{
|
|
357
377
|
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
358
378
|
onError?: ((...args: any[]) => any) | undefined;
|
|
359
379
|
}>, {
|
|
360
380
|
onSuccess: () => void;
|
|
361
381
|
onError: (error: Error) => void;
|
|
382
|
+
orgSlug: string;
|
|
383
|
+
serviceSlug: string;
|
|
362
384
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
363
385
|
|
|
364
386
|
interface OrganizationSwitcherSlotProps {
|
package/dist/index.js
CHANGED
|
@@ -281,7 +281,7 @@ var SignIn = vue.defineComponent({
|
|
|
281
281
|
},
|
|
282
282
|
emits: ["success", "error"],
|
|
283
283
|
setup(props, { slots, emit }) {
|
|
284
|
-
const { client } = useAuthOS();
|
|
284
|
+
const { client, options } = useAuthOS();
|
|
285
285
|
const email = vue.ref("");
|
|
286
286
|
const password = vue.ref("");
|
|
287
287
|
const mfaCode = vue.ref("");
|
|
@@ -296,7 +296,9 @@ var SignIn = vue.defineComponent({
|
|
|
296
296
|
if (step.value === "credentials") {
|
|
297
297
|
const result = await client.auth.login({
|
|
298
298
|
email: email.value,
|
|
299
|
-
password: password.value
|
|
299
|
+
password: password.value,
|
|
300
|
+
org_slug: options.org,
|
|
301
|
+
service_slug: options.service
|
|
300
302
|
});
|
|
301
303
|
if (result.expires_in === MFA_PREAUTH_EXPIRY) {
|
|
302
304
|
preauthToken.value = result.access_token;
|
|
@@ -375,6 +377,16 @@ var SignUp = vue.defineComponent({
|
|
|
375
377
|
onError: {
|
|
376
378
|
type: Function,
|
|
377
379
|
default: void 0
|
|
380
|
+
},
|
|
381
|
+
/** Organization slug for tenant context */
|
|
382
|
+
orgSlug: {
|
|
383
|
+
type: String,
|
|
384
|
+
default: void 0
|
|
385
|
+
},
|
|
386
|
+
/** Service slug for tenant attribution (used with orgSlug) */
|
|
387
|
+
serviceSlug: {
|
|
388
|
+
type: String,
|
|
389
|
+
default: void 0
|
|
378
390
|
}
|
|
379
391
|
},
|
|
380
392
|
emits: ["success", "error"],
|
|
@@ -390,7 +402,9 @@ var SignUp = vue.defineComponent({
|
|
|
390
402
|
try {
|
|
391
403
|
await client.auth.register({
|
|
392
404
|
email: email.value,
|
|
393
|
-
password: password.value
|
|
405
|
+
password: password.value,
|
|
406
|
+
org_slug: props.orgSlug,
|
|
407
|
+
service_slug: props.serviceSlug
|
|
394
408
|
});
|
|
395
409
|
emit("success");
|
|
396
410
|
props.onSuccess?.();
|
package/dist/index.mjs
CHANGED
|
@@ -251,7 +251,7 @@ var SignIn = defineComponent({
|
|
|
251
251
|
},
|
|
252
252
|
emits: ["success", "error"],
|
|
253
253
|
setup(props, { slots, emit }) {
|
|
254
|
-
const { client } = useAuthOS();
|
|
254
|
+
const { client, options } = useAuthOS();
|
|
255
255
|
const email = ref("");
|
|
256
256
|
const password = ref("");
|
|
257
257
|
const mfaCode = ref("");
|
|
@@ -266,7 +266,9 @@ var SignIn = defineComponent({
|
|
|
266
266
|
if (step.value === "credentials") {
|
|
267
267
|
const result = await client.auth.login({
|
|
268
268
|
email: email.value,
|
|
269
|
-
password: password.value
|
|
269
|
+
password: password.value,
|
|
270
|
+
org_slug: options.org,
|
|
271
|
+
service_slug: options.service
|
|
270
272
|
});
|
|
271
273
|
if (result.expires_in === MFA_PREAUTH_EXPIRY) {
|
|
272
274
|
preauthToken.value = result.access_token;
|
|
@@ -345,6 +347,16 @@ var SignUp = defineComponent({
|
|
|
345
347
|
onError: {
|
|
346
348
|
type: Function,
|
|
347
349
|
default: void 0
|
|
350
|
+
},
|
|
351
|
+
/** Organization slug for tenant context */
|
|
352
|
+
orgSlug: {
|
|
353
|
+
type: String,
|
|
354
|
+
default: void 0
|
|
355
|
+
},
|
|
356
|
+
/** Service slug for tenant attribution (used with orgSlug) */
|
|
357
|
+
serviceSlug: {
|
|
358
|
+
type: String,
|
|
359
|
+
default: void 0
|
|
348
360
|
}
|
|
349
361
|
},
|
|
350
362
|
emits: ["success", "error"],
|
|
@@ -360,7 +372,9 @@ var SignUp = defineComponent({
|
|
|
360
372
|
try {
|
|
361
373
|
await client.auth.register({
|
|
362
374
|
email: email.value,
|
|
363
|
-
password: password.value
|
|
375
|
+
password: password.value,
|
|
376
|
+
org_slug: props.orgSlug,
|
|
377
|
+
service_slug: props.serviceSlug
|
|
364
378
|
});
|
|
365
379
|
emit("success");
|
|
366
380
|
props.onSuccess?.();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drmhse/authos-vue",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "Vue and Nuxt adapter for AuthOS authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -68,6 +68,6 @@
|
|
|
68
68
|
"access": "public"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@drmhse/sso-sdk": "^0.3.
|
|
71
|
+
"@drmhse/sso-sdk": "^0.3.10"
|
|
72
72
|
}
|
|
73
73
|
}
|