@aooth/auth-moost 0.2.4 → 0.2.6
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/atscript/index.d.mts +37 -38
- package/dist/atscript/index.mjs +1 -1
- package/dist/{forms-C_VNxSDn.mjs → forms-BUF9oMsE.mjs} +29 -22
- package/dist/index.d.mts +622 -119
- package/dist/index.mjs +1663 -444
- package/package.json +26 -24
- package/src/atscript/models/forms.as +50 -58
- package/src/atscript/models/forms.as.d.ts +37 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aooth/auth-moost",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Moost auth integration for aoothjs — AuthGuard interceptor, useAuth composable, REST endpoints, workflows",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aoothjs",
|
|
@@ -57,33 +57,35 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@atscript/moost-wf": "^0.1.
|
|
61
|
-
"@wooksjs/http-body": "^0.8.
|
|
62
|
-
"@aooth/
|
|
63
|
-
"@aooth/
|
|
64
|
-
"@aooth/user": "0.2.
|
|
65
|
-
"@aooth/idp": "0.2.
|
|
60
|
+
"@atscript/moost-wf": "^0.1.169",
|
|
61
|
+
"@wooksjs/http-body": "^0.8.1",
|
|
62
|
+
"@aooth/auth": "0.2.6",
|
|
63
|
+
"@aooth/arbac-moost": "^0.2.6",
|
|
64
|
+
"@aooth/user": "0.2.6",
|
|
65
|
+
"@aooth/idp": "0.2.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@atscript/core": "^0.2.
|
|
69
|
-
"@atscript/
|
|
70
|
-
"@atscript/
|
|
71
|
-
"@atscript/
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
68
|
+
"@atscript/core": "^0.2.9",
|
|
69
|
+
"@atscript/db": "^0.1.174",
|
|
70
|
+
"@atscript/moost-db": "^0.1.174",
|
|
71
|
+
"@atscript/typescript": "^0.2.9",
|
|
72
|
+
"@atscript/ui": "^0.1.169",
|
|
73
|
+
"@atscript/ui-fns": "^0.1.169",
|
|
74
|
+
"@moostjs/event-http": "^0.7.4",
|
|
75
|
+
"@moostjs/event-wf": "^0.7.4",
|
|
76
|
+
"moost": "^0.7.4",
|
|
77
|
+
"unplugin-atscript": "^0.2.9",
|
|
78
|
+
"wooks": "^0.8.1"
|
|
77
79
|
},
|
|
78
80
|
"peerDependencies": {
|
|
79
|
-
"@atscript/moost-wf": "^0.1.
|
|
80
|
-
"@atscript/typescript": "^0.2.
|
|
81
|
-
"@moostjs/event-http": "^0.7.
|
|
82
|
-
"@moostjs/event-wf": "^0.7.
|
|
83
|
-
"@wooksjs/event-core": "^0.8.
|
|
84
|
-
"@wooksjs/event-http": "^0.8.
|
|
85
|
-
"@wooksjs/http-body": "^0.8.
|
|
86
|
-
"moost": "^0.7.
|
|
81
|
+
"@atscript/moost-wf": "^0.1.169",
|
|
82
|
+
"@atscript/typescript": "^0.2.9",
|
|
83
|
+
"@moostjs/event-http": "^0.7.4",
|
|
84
|
+
"@moostjs/event-wf": "^0.7.4",
|
|
85
|
+
"@wooksjs/event-core": "^0.8.1",
|
|
86
|
+
"@wooksjs/event-http": "^0.8.1",
|
|
87
|
+
"@wooksjs/http-body": "^0.8.1",
|
|
88
|
+
"moost": "^0.7.4"
|
|
87
89
|
},
|
|
88
90
|
"peerDependenciesMeta": {
|
|
89
91
|
"@atscript/typescript": {
|
|
@@ -83,6 +83,7 @@ export interface LoginCredentialsForm {
|
|
|
83
83
|
@ui.form.order 30
|
|
84
84
|
@ui.form.action 'signup', 'Sign up'
|
|
85
85
|
@ui.form.attr 'text', 'Don’t have an account?'
|
|
86
|
+
@ui.form.fn.attr 'text', '(_, _d, _c, _e, t) => t("Don’t have an account?")'
|
|
86
87
|
@ui.form.attr 'align', 'center'
|
|
87
88
|
@ui.form.pushDown
|
|
88
89
|
@ui.form.fn.hidden '(_, _d, ctx) => !ctx.public?.altActions?.signup'
|
|
@@ -97,8 +98,9 @@ export interface LoginCredentialsForm {
|
|
|
97
98
|
|
|
98
99
|
// SSO providers — rendered from `ctx.public.altActions.ssoProviders` by the
|
|
99
100
|
// `AsSsoProviders` one-click picker (registered on `<AsWfForm :components>`).
|
|
100
|
-
// Each provider becomes a full-width button whose
|
|
101
|
-
//
|
|
101
|
+
// Each provider becomes a full-width button whose `text` the expression
|
|
102
|
+
// builds with `t("Continue with {provider}")` (translatable, served in the
|
|
103
|
+
// schema's `$i18n`); a click both selects the provider id and
|
|
102
104
|
// fires the `sso` action — the component is chromeless and suppresses the
|
|
103
105
|
// shell's footer action link, so there is NO separate submit button (the
|
|
104
106
|
// `'Continue'` action label is inert here, kept only because the action
|
|
@@ -113,7 +115,7 @@ export interface LoginCredentialsForm {
|
|
|
113
115
|
// Swap the component via `setupAuthWorkflows({ forms })`.
|
|
114
116
|
@ui.form.order 50
|
|
115
117
|
@ui.form.component 'AsSsoProviders'
|
|
116
|
-
@ui.form.fn.attr 'providers', '(_, _d, ctx) => Array.isArray(ctx.public?.altActions?.ssoProviders) ? ctx.public.altActions.ssoProviders.map((p) => ({ id: p.id, text: "Continue with "
|
|
118
|
+
@ui.form.fn.attr 'providers', '(_, _d, ctx, _e, t) => Array.isArray(ctx.public?.altActions?.ssoProviders) ? ctx.public.altActions.ssoProviders.map((p) => ({ id: p.id, text: t("Continue with {provider}", { provider: p.label }), icon: p.icon })) : []'
|
|
117
119
|
@ui.form.fn.hidden '(_, _d, ctx) => (ctx.public?.altActions?.ssoProviders?.length ?? 0) === 0'
|
|
118
120
|
@meta.label 'Or sign in with'
|
|
119
121
|
@ui.form.action 'sso', 'Continue'
|
|
@@ -135,7 +137,7 @@ export interface LoginCredentialsForm {
|
|
|
135
137
|
@wf.context.pass 'public'
|
|
136
138
|
@ui.form.submit.text 'Verify'
|
|
137
139
|
export interface MfaCodeForm {
|
|
138
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.mfa?.method === "totp" ? "Enter the current 6-digit code from your authenticator app." : ctx.public?.pincode?.sentTo ? "Code sent to "
|
|
140
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.mfa?.method === "totp" ? t("Enter the current 6-digit code from your authenticator app.") : ctx.public?.pincode?.sentTo ? t("Code sent to {recipient}.", { recipient: ctx.public.pincode.sentTo }) : t("Enter your verification code.")'
|
|
139
141
|
transportHint?: ui.paragraph
|
|
140
142
|
|
|
141
143
|
@ui.form.type 'text'
|
|
@@ -216,6 +218,7 @@ export interface SignupForm {
|
|
|
216
218
|
@ui.form.order 20
|
|
217
219
|
@ui.form.action 'backToLogin', 'Sign in'
|
|
218
220
|
@ui.form.attr 'text', 'Already have an account?'
|
|
221
|
+
@ui.form.fn.attr 'text', '(_, _d, _c, _e, t) => t("Already have an account?")'
|
|
219
222
|
@ui.form.attr 'align', 'center'
|
|
220
223
|
@ui.form.pushDown
|
|
221
224
|
backToLogin?: ui.action
|
|
@@ -259,7 +262,7 @@ export interface SignupForm {
|
|
|
259
262
|
* wants to abandon the flow closes / refreshes the page (the wf state token
|
|
260
263
|
* expires per the engine's TTL).
|
|
261
264
|
*/
|
|
262
|
-
@ui.form.fn.title '(_, ctx) => ctx.public?.password?.heading || "Set your password"'
|
|
265
|
+
@ui.form.fn.title '(_, ctx, t) => ctx.public?.password?.heading || t("Set your password")'
|
|
263
266
|
@wf.context.pass 'public'
|
|
264
267
|
export interface SetPasswordForm extends WithInlineConsentForm {
|
|
265
268
|
/**
|
|
@@ -292,7 +295,7 @@ export interface SetPasswordForm extends WithInlineConsentForm {
|
|
|
292
295
|
@meta.sensitive
|
|
293
296
|
@meta.required
|
|
294
297
|
@expect.minLength 8
|
|
295
|
-
@ui.form.validate '(v, data, ctx) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || "Passwords must match"'
|
|
298
|
+
@ui.form.validate '(v, data, ctx, _e, t) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || t("Passwords must match")'
|
|
296
299
|
confirmPassword: string
|
|
297
300
|
|
|
298
301
|
/**
|
|
@@ -395,7 +398,7 @@ export interface Select2faForm {
|
|
|
395
398
|
// always the empty string, so authenticator entries render bare).
|
|
396
399
|
@ui.form.order 10
|
|
397
400
|
@ui.form.type 'radio'
|
|
398
|
-
@ui.form.fn.options '(_, _d, ctx) => Array.isArray(ctx.public?.mfa?.enrolledMethods) ? ctx.public.mfa.enrolledMethods.map(m =>
|
|
401
|
+
@ui.form.fn.options '(_, _d, ctx, _e, t) => Array.isArray(ctx.public?.mfa?.enrolledMethods) ? ctx.public.mfa.enrolledMethods.map(m => { const method = m.kind === "totp" ? t("TOTP (Authenticator app)") : m.kind === "email" ? t("Email") : m.kind === "sms" ? t("SMS") : m.kind; return { key: m.methodName, label: m.masked && (m.kind === "email" || m.kind === "sms") ? t("{method} ({recipient})", { method, recipient: m.masked }) : method }; }) : []'
|
|
399
402
|
@meta.label 'MFA method'
|
|
400
403
|
@meta.required
|
|
401
404
|
methodName: string
|
|
@@ -439,7 +442,7 @@ export interface Select2faForm {
|
|
|
439
442
|
@wf.context.pass 'public'
|
|
440
443
|
@ui.form.submit.text 'Verify'
|
|
441
444
|
export interface PincodeForm {
|
|
442
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.mfa?.method === "totp" ? "Enter the current 6-digit code from your authenticator app." : ctx.public?.pincode?.sentTo ? "Code sent to "
|
|
445
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.mfa?.method === "totp" ? t("Enter the current 6-digit code from your authenticator app.") : ctx.public?.pincode?.sentTo ? t("Code sent to {recipient}.", { recipient: ctx.public.pincode.sentTo }) : t("Enter your verification code.")'
|
|
443
446
|
transportHint?: ui.paragraph
|
|
444
447
|
|
|
445
448
|
@ui.form.type 'text'
|
|
@@ -534,7 +537,7 @@ export interface AskPhoneForm extends WithInlineConsentForm {
|
|
|
534
537
|
export interface EnrollPickMethodForm {
|
|
535
538
|
@ui.form.order 10
|
|
536
539
|
@ui.form.type 'radio'
|
|
537
|
-
@ui.form.fn.options '(_, _d, ctx) => Array.isArray(ctx.public?.mfaEnroll?.availableTransports) ? ctx.public.mfaEnroll.availableTransports.map(
|
|
540
|
+
@ui.form.fn.options '(_, _d, ctx, _e, t) => Array.isArray(ctx.public?.mfaEnroll?.availableTransports) ? ctx.public.mfaEnroll.availableTransports.map(k => ({ key: k, label: k === "totp" ? t("Authenticator app (TOTP)") : k === "sms" ? t("SMS") : k === "email" ? t("Email") : k })) : []'
|
|
538
541
|
@meta.label 'Choose a verification method'
|
|
539
542
|
@meta.required
|
|
540
543
|
method: string
|
|
@@ -561,7 +564,7 @@ export interface EnrollPickMethodForm {
|
|
|
561
564
|
* forbids backing out mid-flow). `useDifferentMethod` is hidden when the
|
|
562
565
|
* consumer has only one transport configured (nothing to switch to).
|
|
563
566
|
*/
|
|
564
|
-
@ui.form.fn.title '(_, ctx) => ctx.public?.mfaEnroll?.method === "sms" ? "Add your phone number" : "Add your email"'
|
|
567
|
+
@ui.form.fn.title '(_, ctx, t) => ctx.public?.mfaEnroll?.method === "sms" ? t("Add your phone number") : t("Add your email")'
|
|
565
568
|
@meta.description 'We will send you a one-time code to confirm.'
|
|
566
569
|
@wf.context.pass 'public'
|
|
567
570
|
@ui.form.submit.text 'Send code'
|
|
@@ -574,12 +577,12 @@ export interface EnrollAddressForm {
|
|
|
574
577
|
// fallback when `@atscript/ui-fns` is absent (the fn key overrides it when
|
|
575
578
|
// present — fn wins over static, else static is the fallback).
|
|
576
579
|
@meta.label 'Address'
|
|
577
|
-
@ui.form.fn.label '(_, _d, ctx) => ctx.public?.mfaEnroll?.method === "sms" ? "Phone number" : ctx.public?.mfaEnroll?.method === "email" ? "Email address" : "Address"'
|
|
580
|
+
@ui.form.fn.label '(_, _d, ctx, _e, t) => ctx.public?.mfaEnroll?.method === "sms" ? t("Phone number") : ctx.public?.mfaEnroll?.method === "email" ? t("Email address") : t("Address")'
|
|
578
581
|
@meta.required
|
|
579
582
|
// Client-side format hint — email branch must look like an email; the SMS
|
|
580
583
|
// branch stays free-form (server-side E.164 normalization). The robust
|
|
581
584
|
// check is server-side in the `enroll-address` step regardless of client.
|
|
582
|
-
@ui.form.validate '(v, _d, ctx) => ctx.public?.mfaEnroll?.method !== "email" || /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || "Enter a valid email address"'
|
|
585
|
+
@ui.form.validate '(v, _d, ctx, _e, t) => ctx.public?.mfaEnroll?.method !== "email" || /^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(v) || t("Enter a valid email address")'
|
|
583
586
|
address: string
|
|
584
587
|
|
|
585
588
|
@ui.form.action 'skip', 'Skip for now'
|
|
@@ -613,7 +616,7 @@ export interface EnrollAddressForm {
|
|
|
613
616
|
@ui.form.submit.text 'Confirm'
|
|
614
617
|
export interface EnrollConfirmForm {
|
|
615
618
|
@ui.form.order 1
|
|
616
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.mfaEnroll?.method === "totp" ? "Enter the 6-digit code from your authenticator app." : ctx.public?.pincode?.sentTo ? "Code sent to
|
|
619
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.mfaEnroll?.method === "totp" ? t("Enter the 6-digit code from your authenticator app.") : ctx.public?.pincode?.sentTo ? t("Code sent to {recipient}. Enter it below to confirm.", { recipient: ctx.public.pincode.sentTo }) : t("Enter the code to confirm enrollment.")'
|
|
617
620
|
transportHint?: ui.paragraph
|
|
618
621
|
|
|
619
622
|
@ui.form.order 10
|
|
@@ -706,18 +709,18 @@ export interface EnrollTotpQrForm {
|
|
|
706
709
|
@ui.form.submit.text 'Continue'
|
|
707
710
|
export interface ManageMfaForm {
|
|
708
711
|
@ui.form.order 5
|
|
709
|
-
@ui.form.fn.value '(_, _d, ctx) => (ctx.public?.manage?.locked?.length ?? 0) > 0 ? "Some methods are also used to sign in and can’t be changed here." : ""'
|
|
712
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => (ctx.public?.manage?.locked?.length ?? 0) > 0 ? t("Some methods are also used to sign in and can’t be changed here.") : ""'
|
|
710
713
|
@ui.form.fn.hidden '(_, _d, ctx) => (ctx.public?.manage?.locked?.length ?? 0) === 0'
|
|
711
714
|
lockedNote: ui.paragraph
|
|
712
715
|
|
|
713
716
|
@ui.form.order 6
|
|
714
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.manage?.removeBlocked ? "Two-factor authentication is required for your account, so your last method can be changed but not removed." : ""'
|
|
717
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.manage?.removeBlocked ? t("Two-factor authentication is required for your account, so your last method can be changed but not removed.") : ""'
|
|
715
718
|
@ui.form.fn.hidden '(_, _d, ctx) => !ctx.public?.manage?.removeBlocked'
|
|
716
719
|
requiredNote: ui.paragraph
|
|
717
720
|
|
|
718
721
|
@ui.form.order 10
|
|
719
722
|
@ui.form.type 'radio'
|
|
720
|
-
@ui.form.fn.options '(_, _d, ctx) => { const lbl = (
|
|
723
|
+
@ui.form.fn.options '(_, _d, ctx, _e, t) => { const lbl = (k) => k === "totp" ? t("authenticator app") : k === "sms" ? t("SMS") : k === "email" ? t("email") : k; const locked = ctx.public?.manage?.locked ?? []; const out = []; for (const k of (ctx.public?.manage?.candidates ?? [])) out.push({ key: "add:" + k, label: t("Add {method}", { method: lbl(k) }) }); for (const m of (ctx.public?.mfa?.enrolledMethods ?? [])) { if (locked.includes(m.kind)) continue; const method = lbl(m.kind); out.push({ key: "replace:" + m.kind, label: m.masked ? t("Change {method} ({recipient})", { method, recipient: m.masked }) : t("Change {method}", { method }) }); if (!ctx.public?.manage?.removeBlocked) out.push({ key: "remove:" + m.kind, label: t("Remove {method}", { method }) }); } return out; }'
|
|
721
724
|
@meta.label 'What would you like to do?'
|
|
722
725
|
@meta.required
|
|
723
726
|
operation: string
|
|
@@ -740,7 +743,7 @@ export interface ManageMfaForm {
|
|
|
740
743
|
@ui.form.submit.text 'Remove'
|
|
741
744
|
export interface RemoveMfaConfirmForm {
|
|
742
745
|
@ui.form.order 1
|
|
743
|
-
@ui.form.fn.value '(_, _d, ctx) => { const
|
|
746
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => { const k = ctx.public?.mfaEnroll?.method; return k === "totp" ? t("Remove your authenticator app as a two-factor method? You can set it up again later.") : k === "sms" ? t("Remove SMS codes as a two-factor method? You can set it up again later.") : k === "email" ? t("Remove email codes as a two-factor method? You can set it up again later.") : t("Remove this method as a two-factor method? You can set it up again later."); }'
|
|
744
747
|
notice: ui.paragraph
|
|
745
748
|
|
|
746
749
|
// Hidden built-in cancel — host renders its own and fires `cancel` on
|
|
@@ -794,7 +797,7 @@ export interface PasswordReauthForm {
|
|
|
794
797
|
@ui.form.submit.text 'Continue'
|
|
795
798
|
export interface StepUpConfirmForm {
|
|
796
799
|
@ui.form.order 1
|
|
797
|
-
@ui.form.fn.value '(_, _d, ctx) => { const kind = ctx.public?.mfa?.method; const m = (ctx.public?.mfa?.enrolledMethods ?? []).find(e => e.kind === kind);
|
|
800
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => { const kind = ctx.public?.mfa?.method; const m = (ctx.public?.mfa?.enrolledMethods ?? []).find(e => e.kind === kind); return m && m.masked ? t("To continue, we will send a verification code to {recipient}.", { recipient: m.masked }) : kind === "sms" ? t("To continue, we will send a verification code to your phone.") : t("To continue, we will send a verification code to your email."); }'
|
|
798
801
|
notice: ui.paragraph
|
|
799
802
|
|
|
800
803
|
@ui.form.action 'useDifferentMethod', 'Use a different method'
|
|
@@ -837,9 +840,10 @@ export interface ConcurrencyLimitForm {
|
|
|
837
840
|
}
|
|
838
841
|
|
|
839
842
|
/**
|
|
840
|
-
* Identifier form
|
|
841
|
-
*
|
|
842
|
-
*
|
|
843
|
+
* Identifier form of the login flow's `magicLink` alt-action
|
|
844
|
+
* (`forms.magicLinkRequest`): an email or username. The link goes to an inbox
|
|
845
|
+
* the account proved; the answer is the same whether or not an account
|
|
846
|
+
* matches.
|
|
843
847
|
*/
|
|
844
848
|
@meta.label 'Sign in with a magic link'
|
|
845
849
|
@meta.description 'Enter your account email or username and we will send you a one-time sign-in link.'
|
|
@@ -853,8 +857,25 @@ export interface MagicLinkRequestForm {
|
|
|
853
857
|
}
|
|
854
858
|
|
|
855
859
|
/**
|
|
856
|
-
*
|
|
857
|
-
*
|
|
860
|
+
* Landing step of a clicked magic link (`forms.magicLinkConfirm`): "Continue
|
|
861
|
+
* as a•••@example.com". Opening the link only renders this form — the link is
|
|
862
|
+
* used up when it is submitted — so a mail scanner that opens links does not
|
|
863
|
+
* spend it, and the masked account shows which account the link is for.
|
|
864
|
+
*/
|
|
865
|
+
@meta.label 'Continue with your link'
|
|
866
|
+
@wf.context.pass 'public'
|
|
867
|
+
@ui.form.submit.text 'Continue'
|
|
868
|
+
export interface MagicLinkConfirmForm {
|
|
869
|
+
@ui.form.order 1
|
|
870
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.magicLink?.account ? t("Continue as {account}.", { account: ctx.public.magicLink.account }) : t("Continue with the link from your email.")'
|
|
871
|
+
notice: ui.paragraph
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Recovery delivery-mode picker (`forms.recoveryModeSelect`) — rendered after
|
|
876
|
+
* the identifier when `resolveRecoveryDeliveryMode()` returns `'choice'`, for
|
|
877
|
+
* known and unknown identifiers alike. `magicLink` sends a single-use link,
|
|
878
|
+
* `otp` a one-time code.
|
|
858
879
|
*/
|
|
859
880
|
@meta.label 'Choose how to verify'
|
|
860
881
|
@meta.description 'Pick how you would like to recover access.'
|
|
@@ -869,35 +890,6 @@ export interface RecoveryModeSelectForm {
|
|
|
869
890
|
|
|
870
891
|
}
|
|
871
892
|
|
|
872
|
-
/**
|
|
873
|
-
* Recovery factor-verification form — used when
|
|
874
|
-
* `RecoveryWorkflowOptions.requireKnownRecoveryFactor` is true. The user
|
|
875
|
-
* picks a factor type and supplies its value; the server validates against
|
|
876
|
-
* the enrolled factor (phone last-4 or current TOTP code). Options are
|
|
877
|
-
* built from `ctx.public.preReset.availableRecoveryFactors` (workflow whitelist ∩
|
|
878
|
-
* user's enrolled factors), so users only see factors they can actually
|
|
879
|
-
* verify AND that the admin hasn't disabled via `opts.preReset.allowedFactors`.
|
|
880
|
-
*/
|
|
881
|
-
@meta.label 'Verify your identity'
|
|
882
|
-
@meta.description 'Confirm a detail we have on file before resetting your password.'
|
|
883
|
-
@wf.context.pass 'public'
|
|
884
|
-
export interface RecoveryFactorForm {
|
|
885
|
-
@ui.form.order 10
|
|
886
|
-
@ui.form.type 'radio'
|
|
887
|
-
@ui.form.fn.options '(_, _d, ctx) => Array.isArray(ctx.public?.preReset?.availableRecoveryFactors) ? ctx.public.preReset.availableRecoveryFactors : []'
|
|
888
|
-
@meta.label 'Factor'
|
|
889
|
-
@meta.required
|
|
890
|
-
factor: string
|
|
891
|
-
|
|
892
|
-
@ui.form.order 20
|
|
893
|
-
@ui.form.type 'text'
|
|
894
|
-
@meta.label 'Value'
|
|
895
|
-
@meta.required
|
|
896
|
-
@expect.minLength 4
|
|
897
|
-
@expect.maxLength 12
|
|
898
|
-
value: string
|
|
899
|
-
}
|
|
900
|
-
|
|
901
893
|
/**
|
|
902
894
|
* Authenticated "change my password" form — surfaced by the
|
|
903
895
|
* change-password.flow `change-password-form` step to a SIGNED-IN user.
|
|
@@ -912,7 +904,7 @@ export interface RecoveryFactorForm {
|
|
|
912
904
|
* `SetPasswordForm`, so the live `AsPasswordRules` renderer and dynamic copy
|
|
913
905
|
* work identically. Heading/intro are staged by `change-password-form`.
|
|
914
906
|
*/
|
|
915
|
-
@ui.form.fn.title '(_, ctx) => ctx.public?.password?.heading || "Change your password"'
|
|
907
|
+
@ui.form.fn.title '(_, ctx, t) => ctx.public?.password?.heading || t("Change your password")'
|
|
916
908
|
@ui.form.submit.text 'Change password'
|
|
917
909
|
@wf.context.pass 'public'
|
|
918
910
|
export interface ChangePasswordForm {
|
|
@@ -946,7 +938,7 @@ export interface ChangePasswordForm {
|
|
|
946
938
|
@meta.sensitive
|
|
947
939
|
@meta.required
|
|
948
940
|
@expect.minLength 8
|
|
949
|
-
@ui.form.validate '(v, data, ctx) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || "Passwords must match"'
|
|
941
|
+
@ui.form.validate '(v, data, ctx, _e, t) => v === data.newPassword || ctx?.public?.messages?.PASSWORDS_DO_NOT_MATCH || t("Passwords must match")'
|
|
950
942
|
confirmPassword: string
|
|
951
943
|
|
|
952
944
|
@ui.form.order 25
|
|
@@ -982,7 +974,7 @@ export interface ChangePasswordForm {
|
|
|
982
974
|
@ui.form.submit.text 'Verify and link'
|
|
983
975
|
export interface ProveControlForm {
|
|
984
976
|
@ui.form.order 5
|
|
985
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.proveControl?.hint ? "An account for
|
|
977
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.proveControl?.hint ? t("An account for {account} already exists. Enter its password to link this sign-in method.", { account: ctx.public.proveControl.hint }) : t("Enter your existing account password to link this sign-in method.")'
|
|
986
978
|
intro: ui.paragraph
|
|
987
979
|
|
|
988
980
|
@ui.form.order 10
|
|
@@ -1017,7 +1009,7 @@ export interface ProveControlForm {
|
|
|
1017
1009
|
@ui.form.submit.text 'Verify and link'
|
|
1018
1010
|
export interface ProveControlOtpForm {
|
|
1019
1011
|
@ui.form.order 5
|
|
1020
|
-
@ui.form.fn.value '(_, _d, ctx) => ctx.public?.proveControl?.sentTo ? "We sent a verification code to
|
|
1012
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => ctx.public?.proveControl?.sentTo ? t("We sent a verification code to {recipient}. Enter it to link this sign-in method to your existing account.", { recipient: ctx.public.proveControl.sentTo }) : t("Enter the verification code to link this sign-in method to your existing account.")'
|
|
1021
1013
|
intro: ui.paragraph
|
|
1022
1014
|
|
|
1023
1015
|
@ui.form.order 10
|
|
@@ -1069,12 +1061,12 @@ export interface ProveControlOtpForm {
|
|
|
1069
1061
|
@ui.form.submit.text 'Authorize'
|
|
1070
1062
|
export interface AuthorizeConsentForm {
|
|
1071
1063
|
@ui.form.order 1
|
|
1072
|
-
@ui.form.fn.value '(_, _d, ctx) => { const a = ctx.public?.authz; const
|
|
1064
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => { const a = ctx.public?.authz; const who = a?.clientName && a?.redirectHost ? t("“{client}” ({host}) wants to sign in to your account.", { client: a.clientName, host: a.redirectHost }) : a?.clientName ? t("“{client}” wants to sign in to your account.", { client: a.clientName }) : t("A local application wants to sign in to your account."); const sc = a?.scope ? " " + t("It is requesting access to: {scope}.", { scope: a.scope }) : ""; return who + sc + " " + t("Authorize this only if you started it."); }'
|
|
1073
1065
|
notice: ui.paragraph
|
|
1074
1066
|
|
|
1075
1067
|
@ui.form.order 2
|
|
1076
1068
|
@ui.form.fn.hidden '(_, _d, ctx) => !ctx.public?.authz?.signedInAs'
|
|
1077
|
-
@ui.form.fn.value '(_, _d, ctx) => "Signed in as "
|
|
1069
|
+
@ui.form.fn.value '(_, _d, ctx, _e, t) => t("Signed in as {account}.", { account: ctx.public?.authz?.signedInAs || "" })'
|
|
1078
1070
|
signedIn: ui.paragraph
|
|
1079
1071
|
|
|
1080
1072
|
@ui.form.order 10
|
|
@@ -47,7 +47,7 @@ export declare class LoginCredentialsForm {
|
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
49
|
* Atscript interface **MfaCodeForm**
|
|
50
|
-
* @see {@link ./forms.as:
|
|
50
|
+
* @see {@link ./forms.as:139:18}
|
|
51
51
|
*/
|
|
52
52
|
export declare class MfaCodeForm {
|
|
53
53
|
// transportHint: ui.paragraph
|
|
@@ -66,7 +66,7 @@ export declare class MfaCodeForm {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Atscript interface **EmailIdentifierForm**
|
|
69
|
-
* @see {@link ./forms.as:
|
|
69
|
+
* @see {@link ./forms.as:176:18}
|
|
70
70
|
*/
|
|
71
71
|
export declare class EmailIdentifierForm {
|
|
72
72
|
email: string /* email */
|
|
@@ -83,7 +83,7 @@ export declare class EmailIdentifierForm {
|
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Atscript interface **SignupForm**
|
|
86
|
-
* @see {@link ./forms.as:
|
|
86
|
+
* @see {@link ./forms.as:208:18}
|
|
87
87
|
*/
|
|
88
88
|
export declare class SignupForm {
|
|
89
89
|
email: string /* email */
|
|
@@ -100,7 +100,7 @@ export declare class SignupForm {
|
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
102
|
* Atscript interface **SetPasswordForm**
|
|
103
|
-
* @see {@link ./forms.as:
|
|
103
|
+
* @see {@link ./forms.as:267:18}
|
|
104
104
|
*/
|
|
105
105
|
export declare class SetPasswordForm extends WithInlineConsentForm {
|
|
106
106
|
// intro: ui.paragraph
|
|
@@ -119,7 +119,7 @@ export declare class SetPasswordForm extends WithInlineConsentForm {
|
|
|
119
119
|
|
|
120
120
|
/**
|
|
121
121
|
* Atscript interface **InviteForm**
|
|
122
|
-
* @see {@link ./forms.as:
|
|
122
|
+
* @see {@link ./forms.as:345:18}
|
|
123
123
|
*/
|
|
124
124
|
export declare class InviteForm {
|
|
125
125
|
email: string /* email */
|
|
@@ -136,7 +136,7 @@ export declare class InviteForm {
|
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
138
|
* Atscript interface **InviteChooseUsernameForm**
|
|
139
|
-
* @see {@link ./forms.as:
|
|
139
|
+
* @see {@link ./forms.as:370:18}
|
|
140
140
|
*/
|
|
141
141
|
export declare class InviteChooseUsernameForm {
|
|
142
142
|
username: string
|
|
@@ -152,7 +152,7 @@ export declare class InviteChooseUsernameForm {
|
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* Atscript interface **Select2faForm**
|
|
155
|
-
* @see {@link ./forms.as:
|
|
155
|
+
* @see {@link ./forms.as:394:18}
|
|
156
156
|
*/
|
|
157
157
|
export declare class Select2faForm {
|
|
158
158
|
methodName: string
|
|
@@ -170,7 +170,7 @@ export declare class Select2faForm {
|
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Atscript interface **PincodeForm**
|
|
173
|
-
* @see {@link ./forms.as:
|
|
173
|
+
* @see {@link ./forms.as:444:18}
|
|
174
174
|
*/
|
|
175
175
|
export declare class PincodeForm {
|
|
176
176
|
// transportHint: ui.paragraph
|
|
@@ -191,7 +191,7 @@ export declare class PincodeForm {
|
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Atscript interface **AskEmailForm**
|
|
194
|
-
* @see {@link ./forms.as:
|
|
194
|
+
* @see {@link ./forms.as:483:18}
|
|
195
195
|
*/
|
|
196
196
|
export declare class AskEmailForm extends WithInlineConsentForm {
|
|
197
197
|
// disclosure: ui.paragraph
|
|
@@ -208,7 +208,7 @@ export declare class AskEmailForm extends WithInlineConsentForm {
|
|
|
208
208
|
|
|
209
209
|
/**
|
|
210
210
|
* Atscript interface **AskPhoneForm**
|
|
211
|
-
* @see {@link ./forms.as:
|
|
211
|
+
* @see {@link ./forms.as:513:18}
|
|
212
212
|
*/
|
|
213
213
|
export declare class AskPhoneForm extends WithInlineConsentForm {
|
|
214
214
|
// disclosure: ui.paragraph
|
|
@@ -225,7 +225,7 @@ export declare class AskPhoneForm extends WithInlineConsentForm {
|
|
|
225
225
|
|
|
226
226
|
/**
|
|
227
227
|
* Atscript interface **EnrollPickMethodForm**
|
|
228
|
-
* @see {@link ./forms.as:
|
|
228
|
+
* @see {@link ./forms.as:537:18}
|
|
229
229
|
*/
|
|
230
230
|
export declare class EnrollPickMethodForm {
|
|
231
231
|
method: string
|
|
@@ -243,7 +243,7 @@ export declare class EnrollPickMethodForm {
|
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
245
|
* Atscript interface **EnrollAddressForm**
|
|
246
|
-
* @see {@link ./forms.as:
|
|
246
|
+
* @see {@link ./forms.as:571:18}
|
|
247
247
|
*/
|
|
248
248
|
export declare class EnrollAddressForm {
|
|
249
249
|
address: string
|
|
@@ -262,7 +262,7 @@ export declare class EnrollAddressForm {
|
|
|
262
262
|
|
|
263
263
|
/**
|
|
264
264
|
* Atscript interface **EnrollConfirmForm**
|
|
265
|
-
* @see {@link ./forms.as:
|
|
265
|
+
* @see {@link ./forms.as:617:18}
|
|
266
266
|
*/
|
|
267
267
|
export declare class EnrollConfirmForm {
|
|
268
268
|
// transportHint: ui.paragraph
|
|
@@ -283,7 +283,7 @@ export declare class EnrollConfirmForm {
|
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Atscript interface **EnrollTotpQrForm**
|
|
286
|
-
* @see {@link ./forms.as:
|
|
286
|
+
* @see {@link ./forms.as:667:18}
|
|
287
287
|
*/
|
|
288
288
|
export declare class EnrollTotpQrForm {
|
|
289
289
|
// qrCode: ui.paragraph
|
|
@@ -302,7 +302,7 @@ export declare class EnrollTotpQrForm {
|
|
|
302
302
|
|
|
303
303
|
/**
|
|
304
304
|
* Atscript interface **ManageMfaForm**
|
|
305
|
-
* @see {@link ./forms.as:
|
|
305
|
+
* @see {@link ./forms.as:710:18}
|
|
306
306
|
*/
|
|
307
307
|
export declare class ManageMfaForm {
|
|
308
308
|
// lockedNote: ui.paragraph
|
|
@@ -321,7 +321,7 @@ export declare class ManageMfaForm {
|
|
|
321
321
|
|
|
322
322
|
/**
|
|
323
323
|
* Atscript interface **RemoveMfaConfirmForm**
|
|
324
|
-
* @see {@link ./forms.as:
|
|
324
|
+
* @see {@link ./forms.as:744:18}
|
|
325
325
|
*/
|
|
326
326
|
export declare class RemoveMfaConfirmForm {
|
|
327
327
|
// notice: ui.paragraph
|
|
@@ -338,7 +338,7 @@ export declare class RemoveMfaConfirmForm {
|
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
340
|
* Atscript interface **PasswordReauthForm**
|
|
341
|
-
* @see {@link ./forms.as:
|
|
341
|
+
* @see {@link ./forms.as:767:18}
|
|
342
342
|
*/
|
|
343
343
|
export declare class PasswordReauthForm {
|
|
344
344
|
password: string
|
|
@@ -355,7 +355,7 @@ export declare class PasswordReauthForm {
|
|
|
355
355
|
|
|
356
356
|
/**
|
|
357
357
|
* Atscript interface **StepUpConfirmForm**
|
|
358
|
-
* @see {@link ./forms.as:
|
|
358
|
+
* @see {@link ./forms.as:798:18}
|
|
359
359
|
*/
|
|
360
360
|
export declare class StepUpConfirmForm {
|
|
361
361
|
// notice: ui.paragraph
|
|
@@ -373,7 +373,7 @@ export declare class StepUpConfirmForm {
|
|
|
373
373
|
|
|
374
374
|
/**
|
|
375
375
|
* Atscript interface **TermsBumpForm**
|
|
376
|
-
* @see {@link ./forms.as:
|
|
376
|
+
* @see {@link ./forms.as:826:18}
|
|
377
377
|
*/
|
|
378
378
|
export declare class TermsBumpForm extends WithInlineConsentForm {
|
|
379
379
|
static __is_atscript_annotated_type: true
|
|
@@ -388,7 +388,7 @@ export declare class TermsBumpForm extends WithInlineConsentForm {
|
|
|
388
388
|
|
|
389
389
|
/**
|
|
390
390
|
* Atscript interface **ConcurrencyLimitForm**
|
|
391
|
-
* @see {@link ./forms.as:
|
|
391
|
+
* @see {@link ./forms.as:839:18}
|
|
392
392
|
*/
|
|
393
393
|
export declare class ConcurrencyLimitForm {
|
|
394
394
|
static __is_atscript_annotated_type: true
|
|
@@ -403,7 +403,7 @@ export declare class ConcurrencyLimitForm {
|
|
|
403
403
|
|
|
404
404
|
/**
|
|
405
405
|
* Atscript interface **MagicLinkRequestForm**
|
|
406
|
-
* @see {@link ./forms.as:
|
|
406
|
+
* @see {@link ./forms.as:850:18}
|
|
407
407
|
*/
|
|
408
408
|
export declare class MagicLinkRequestForm {
|
|
409
409
|
identifier: string
|
|
@@ -418,15 +418,15 @@ export declare class MagicLinkRequestForm {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
/**
|
|
421
|
-
* Atscript interface **
|
|
422
|
-
* @see {@link ./forms.as:
|
|
421
|
+
* Atscript interface **MagicLinkConfirmForm**
|
|
422
|
+
* @see {@link ./forms.as:868:18}
|
|
423
423
|
*/
|
|
424
|
-
export declare class
|
|
425
|
-
|
|
424
|
+
export declare class MagicLinkConfirmForm {
|
|
425
|
+
// notice: ui.paragraph
|
|
426
426
|
static __is_atscript_annotated_type: true
|
|
427
|
-
static type: TAtscriptTypeObject<keyof
|
|
427
|
+
static type: TAtscriptTypeObject<keyof MagicLinkConfirmForm, MagicLinkConfirmForm>
|
|
428
428
|
static metadata: TMetadataMap<AtscriptMetadata>
|
|
429
|
-
static validator: (opts?: Partial<TValidatorOptions>) => Validator<typeof
|
|
429
|
+
static validator: (opts?: Partial<TValidatorOptions>) => Validator<typeof MagicLinkConfirmForm>
|
|
430
430
|
/** @deprecated JSON Schema support is disabled. Calling this method will throw a runtime error. To enable, set `jsonSchema: 'lazy'` or `jsonSchema: 'bundle'` in tsPlugin options, or add `@emit.jsonSchema` annotation to individual interfaces. */
|
|
431
431
|
static toJsonSchema: () => any
|
|
432
432
|
/** @deprecated Example Data support is disabled. To enable, set `exampleData: true` in tsPlugin options. */
|
|
@@ -434,16 +434,15 @@ export declare class RecoveryModeSelectForm {
|
|
|
434
434
|
}
|
|
435
435
|
|
|
436
436
|
/**
|
|
437
|
-
* Atscript interface **
|
|
438
|
-
* @see {@link ./forms.as:
|
|
437
|
+
* Atscript interface **RecoveryModeSelectForm**
|
|
438
|
+
* @see {@link ./forms.as:882:18}
|
|
439
439
|
*/
|
|
440
|
-
export declare class
|
|
441
|
-
|
|
442
|
-
value: string
|
|
440
|
+
export declare class RecoveryModeSelectForm {
|
|
441
|
+
mode: string
|
|
443
442
|
static __is_atscript_annotated_type: true
|
|
444
|
-
static type: TAtscriptTypeObject<keyof
|
|
443
|
+
static type: TAtscriptTypeObject<keyof RecoveryModeSelectForm, RecoveryModeSelectForm>
|
|
445
444
|
static metadata: TMetadataMap<AtscriptMetadata>
|
|
446
|
-
static validator: (opts?: Partial<TValidatorOptions>) => Validator<typeof
|
|
445
|
+
static validator: (opts?: Partial<TValidatorOptions>) => Validator<typeof RecoveryModeSelectForm>
|
|
447
446
|
/** @deprecated JSON Schema support is disabled. Calling this method will throw a runtime error. To enable, set `jsonSchema: 'lazy'` or `jsonSchema: 'bundle'` in tsPlugin options, or add `@emit.jsonSchema` annotation to individual interfaces. */
|
|
448
447
|
static toJsonSchema: () => any
|
|
449
448
|
/** @deprecated Example Data support is disabled. To enable, set `exampleData: true` in tsPlugin options. */
|
|
@@ -452,7 +451,7 @@ export declare class RecoveryFactorForm {
|
|
|
452
451
|
|
|
453
452
|
/**
|
|
454
453
|
* Atscript interface **ChangePasswordForm**
|
|
455
|
-
* @see {@link ./forms.as:
|
|
454
|
+
* @see {@link ./forms.as:910:18}
|
|
456
455
|
*/
|
|
457
456
|
export declare class ChangePasswordForm {
|
|
458
457
|
// intro: ui.paragraph
|
|
@@ -472,7 +471,7 @@ export declare class ChangePasswordForm {
|
|
|
472
471
|
|
|
473
472
|
/**
|
|
474
473
|
* Atscript interface **ProveControlForm**
|
|
475
|
-
* @see {@link ./forms.as:
|
|
474
|
+
* @see {@link ./forms.as:975:18}
|
|
476
475
|
*/
|
|
477
476
|
export declare class ProveControlForm {
|
|
478
477
|
// intro: ui.paragraph
|
|
@@ -490,7 +489,7 @@ export declare class ProveControlForm {
|
|
|
490
489
|
|
|
491
490
|
/**
|
|
492
491
|
* Atscript interface **ProveControlOtpForm**
|
|
493
|
-
* @see {@link ./forms.as:
|
|
492
|
+
* @see {@link ./forms.as:1010:18}
|
|
494
493
|
*/
|
|
495
494
|
export declare class ProveControlOtpForm {
|
|
496
495
|
// intro: ui.paragraph
|
|
@@ -509,7 +508,7 @@ export declare class ProveControlOtpForm {
|
|
|
509
508
|
|
|
510
509
|
/**
|
|
511
510
|
* Atscript interface **AuthorizeConsentForm**
|
|
512
|
-
* @see {@link ./forms.as:
|
|
511
|
+
* @see {@link ./forms.as:1062:18}
|
|
513
512
|
*/
|
|
514
513
|
export declare class AuthorizeConsentForm {
|
|
515
514
|
// notice: ui.paragraph
|