@sylphx/auth-solid 0.1.2 → 0.1.4
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 +27 -3
- package/dist/browser.js +797 -335
- package/dist/index.d.ts +2 -1
- package/dist/locale.d.ts +1 -1
- package/dist/messages-iberian.d.ts +154 -0
- package/dist/messages.d.ts +223 -0
- package/dist/passkey-enroll.d.ts +11 -0
- package/dist/server.js +523 -124
- package/dist/sign-in-controller.d.ts +13 -22
- package/dist/sign-in-messages.d.ts +3 -0
- package/dist/sign-in-request.d.ts +24 -0
- package/dist/sign-in-webauthn.d.ts +2 -0
- package/dist/sign-in.css +9 -0
- package/dist/sign-in.d.ts +7 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { resolveAuthLocale } from './locale.js';
|
|
2
|
-
export { type AuthLocale, catalogs as signInMessages, localeNames } from './messages.js';
|
|
2
|
+
export { type AuthLocale, catalogs as signInMessages, localeNames, resolveSignInMessages, type SignInMessages, type SignInMessagesOverride, } from './messages.js';
|
|
3
|
+
export { SylphxPasskeyEnroll, type SylphxPasskeyEnrollProps } from './passkey-enroll.js';
|
|
3
4
|
export { type SignInAppearance, type SignInClass, type SignInToken, SylphxSignIn, type SylphxSignInProps, } from './sign-in.js';
|
|
4
5
|
export { createSignInController, type SignInControllerOptions, type SignInErrorCode, type SignInStep, } from './sign-in-controller.js';
|
package/dist/locale.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare const DEFAULT_AUTH_LOCALE: AuthLocale;
|
|
|
3
3
|
/** Select a shipped language without comparing raw locale strings or relying on the host's locale. */
|
|
4
4
|
export declare function resolveAuthLocale(preferences: readonly string[]): AuthLocale;
|
|
5
5
|
/** Format a countdown without assuming digit shapes, spacing or translated unit order. */
|
|
6
|
-
export declare function authSecondsFormat(locale:
|
|
6
|
+
export declare function authSecondsFormat(locale: string): Intl.NumberFormat;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export declare const es: {
|
|
2
|
+
lastUsed: string;
|
|
3
|
+
forgotPassword: string;
|
|
4
|
+
recoverAccount: string;
|
|
5
|
+
recoverDescription: string;
|
|
6
|
+
sendResetLink: string;
|
|
7
|
+
recoverySent: string;
|
|
8
|
+
recoverySentDescription: string;
|
|
9
|
+
addPasskey: string;
|
|
10
|
+
passkeyAdded: string;
|
|
11
|
+
signIn: string;
|
|
12
|
+
enterPassword: string;
|
|
13
|
+
createYourAccount: string;
|
|
14
|
+
checkInbox: string;
|
|
15
|
+
confirmEmail: string;
|
|
16
|
+
verifyIdentity: string;
|
|
17
|
+
chooseMethod: string;
|
|
18
|
+
startWithEmail: string;
|
|
19
|
+
checkEmailDescription: string;
|
|
20
|
+
confirmEmailDescription: string;
|
|
21
|
+
enterEmailCode: (email: string) => string;
|
|
22
|
+
enterRecovery: string;
|
|
23
|
+
enterAuthenticator: string;
|
|
24
|
+
loading: string;
|
|
25
|
+
retry: string;
|
|
26
|
+
openingProvider: (provider: string) => string;
|
|
27
|
+
continueProvider: (provider: string) => string;
|
|
28
|
+
orEmail: string;
|
|
29
|
+
email: string;
|
|
30
|
+
sendingCode: string;
|
|
31
|
+
emailCodeAction: string;
|
|
32
|
+
continueEmail: string;
|
|
33
|
+
waitingPasskey: string;
|
|
34
|
+
usePasskey: string;
|
|
35
|
+
newHere: string;
|
|
36
|
+
createAnAccount: string;
|
|
37
|
+
noMethods: string;
|
|
38
|
+
password: string;
|
|
39
|
+
hidePassword: string;
|
|
40
|
+
showPassword: string;
|
|
41
|
+
hide: string;
|
|
42
|
+
show: string;
|
|
43
|
+
minimumPassword: string;
|
|
44
|
+
working: string;
|
|
45
|
+
createAccount: string;
|
|
46
|
+
confirmAndSignIn: string;
|
|
47
|
+
changeEmailOrMethod: string;
|
|
48
|
+
backToSignIn: string;
|
|
49
|
+
emailCode: string;
|
|
50
|
+
checkingCode: string;
|
|
51
|
+
verifyCode: string;
|
|
52
|
+
resendIn: (duration: string) => string;
|
|
53
|
+
resendCode: string;
|
|
54
|
+
changeEmail: string;
|
|
55
|
+
usePassword: string;
|
|
56
|
+
recoveryCode: string;
|
|
57
|
+
authenticatorCode: string;
|
|
58
|
+
verifyAndSignIn: string;
|
|
59
|
+
useAuthenticator: string;
|
|
60
|
+
useRecovery: string;
|
|
61
|
+
language: string;
|
|
62
|
+
errors: {
|
|
63
|
+
signin: string;
|
|
64
|
+
cancelled: string;
|
|
65
|
+
use_existing: string;
|
|
66
|
+
invalid_credentials: string;
|
|
67
|
+
acceptance_required: string;
|
|
68
|
+
verify_email: string;
|
|
69
|
+
verification_failed: string;
|
|
70
|
+
invalid_code: string;
|
|
71
|
+
method_unavailable: string;
|
|
72
|
+
signup_failed: string;
|
|
73
|
+
invalid_input: string;
|
|
74
|
+
try_later: string;
|
|
75
|
+
unavailable: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const ptBR: {
|
|
79
|
+
lastUsed: string;
|
|
80
|
+
forgotPassword: string;
|
|
81
|
+
recoverAccount: string;
|
|
82
|
+
recoverDescription: string;
|
|
83
|
+
sendResetLink: string;
|
|
84
|
+
recoverySent: string;
|
|
85
|
+
recoverySentDescription: string;
|
|
86
|
+
addPasskey: string;
|
|
87
|
+
passkeyAdded: string;
|
|
88
|
+
signIn: string;
|
|
89
|
+
enterPassword: string;
|
|
90
|
+
createYourAccount: string;
|
|
91
|
+
checkInbox: string;
|
|
92
|
+
confirmEmail: string;
|
|
93
|
+
verifyIdentity: string;
|
|
94
|
+
chooseMethod: string;
|
|
95
|
+
startWithEmail: string;
|
|
96
|
+
checkEmailDescription: string;
|
|
97
|
+
confirmEmailDescription: string;
|
|
98
|
+
enterEmailCode: (email: string) => string;
|
|
99
|
+
enterRecovery: string;
|
|
100
|
+
enterAuthenticator: string;
|
|
101
|
+
loading: string;
|
|
102
|
+
retry: string;
|
|
103
|
+
openingProvider: (provider: string) => string;
|
|
104
|
+
continueProvider: (provider: string) => string;
|
|
105
|
+
orEmail: string;
|
|
106
|
+
email: string;
|
|
107
|
+
sendingCode: string;
|
|
108
|
+
emailCodeAction: string;
|
|
109
|
+
continueEmail: string;
|
|
110
|
+
waitingPasskey: string;
|
|
111
|
+
usePasskey: string;
|
|
112
|
+
newHere: string;
|
|
113
|
+
createAnAccount: string;
|
|
114
|
+
noMethods: string;
|
|
115
|
+
password: string;
|
|
116
|
+
hidePassword: string;
|
|
117
|
+
showPassword: string;
|
|
118
|
+
hide: string;
|
|
119
|
+
show: string;
|
|
120
|
+
minimumPassword: string;
|
|
121
|
+
working: string;
|
|
122
|
+
createAccount: string;
|
|
123
|
+
confirmAndSignIn: string;
|
|
124
|
+
changeEmailOrMethod: string;
|
|
125
|
+
backToSignIn: string;
|
|
126
|
+
emailCode: string;
|
|
127
|
+
checkingCode: string;
|
|
128
|
+
verifyCode: string;
|
|
129
|
+
resendIn: (duration: string) => string;
|
|
130
|
+
resendCode: string;
|
|
131
|
+
changeEmail: string;
|
|
132
|
+
usePassword: string;
|
|
133
|
+
recoveryCode: string;
|
|
134
|
+
authenticatorCode: string;
|
|
135
|
+
verifyAndSignIn: string;
|
|
136
|
+
useAuthenticator: string;
|
|
137
|
+
useRecovery: string;
|
|
138
|
+
language: string;
|
|
139
|
+
errors: {
|
|
140
|
+
signin: string;
|
|
141
|
+
cancelled: string;
|
|
142
|
+
use_existing: string;
|
|
143
|
+
invalid_credentials: string;
|
|
144
|
+
acceptance_required: string;
|
|
145
|
+
verify_email: string;
|
|
146
|
+
verification_failed: string;
|
|
147
|
+
invalid_code: string;
|
|
148
|
+
method_unavailable: string;
|
|
149
|
+
signup_failed: string;
|
|
150
|
+
invalid_input: string;
|
|
151
|
+
try_later: string;
|
|
152
|
+
unavailable: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
package/dist/messages.d.ts
CHANGED
|
@@ -51,6 +51,15 @@ export type SignInMessages = {
|
|
|
51
51
|
useAuthenticator: string;
|
|
52
52
|
useRecovery: string;
|
|
53
53
|
language: string;
|
|
54
|
+
lastUsed: string;
|
|
55
|
+
forgotPassword: string;
|
|
56
|
+
recoverAccount: string;
|
|
57
|
+
recoverDescription: string;
|
|
58
|
+
sendResetLink: string;
|
|
59
|
+
recoverySent: string;
|
|
60
|
+
recoverySentDescription: string;
|
|
61
|
+
addPasskey: string;
|
|
62
|
+
passkeyAdded: string;
|
|
54
63
|
errors: {
|
|
55
64
|
signin: string;
|
|
56
65
|
cancelled: string;
|
|
@@ -69,6 +78,15 @@ export type SignInMessages = {
|
|
|
69
78
|
};
|
|
70
79
|
export declare const catalogs: {
|
|
71
80
|
en: {
|
|
81
|
+
lastUsed: string;
|
|
82
|
+
forgotPassword: string;
|
|
83
|
+
recoverAccount: string;
|
|
84
|
+
recoverDescription: string;
|
|
85
|
+
sendResetLink: string;
|
|
86
|
+
recoverySent: string;
|
|
87
|
+
recoverySentDescription: string;
|
|
88
|
+
addPasskey: string;
|
|
89
|
+
passkeyAdded: string;
|
|
72
90
|
signIn: string;
|
|
73
91
|
enterPassword: string;
|
|
74
92
|
createYourAccount: string;
|
|
@@ -137,6 +155,15 @@ export declare const catalogs: {
|
|
|
137
155
|
};
|
|
138
156
|
};
|
|
139
157
|
'zh-Hant-HK': {
|
|
158
|
+
lastUsed: string;
|
|
159
|
+
forgotPassword: string;
|
|
160
|
+
recoverAccount: string;
|
|
161
|
+
recoverDescription: string;
|
|
162
|
+
sendResetLink: string;
|
|
163
|
+
recoverySent: string;
|
|
164
|
+
recoverySentDescription: string;
|
|
165
|
+
addPasskey: string;
|
|
166
|
+
passkeyAdded: string;
|
|
140
167
|
signIn: string;
|
|
141
168
|
enterPassword: string;
|
|
142
169
|
createYourAccount: string;
|
|
@@ -205,6 +232,15 @@ export declare const catalogs: {
|
|
|
205
232
|
};
|
|
206
233
|
};
|
|
207
234
|
'zh-Hant-TW': {
|
|
235
|
+
lastUsed: string;
|
|
236
|
+
forgotPassword: string;
|
|
237
|
+
recoverAccount: string;
|
|
238
|
+
recoverDescription: string;
|
|
239
|
+
sendResetLink: string;
|
|
240
|
+
recoverySent: string;
|
|
241
|
+
recoverySentDescription: string;
|
|
242
|
+
addPasskey: string;
|
|
243
|
+
passkeyAdded: string;
|
|
208
244
|
signIn: string;
|
|
209
245
|
enterPassword: string;
|
|
210
246
|
createYourAccount: string;
|
|
@@ -273,6 +309,15 @@ export declare const catalogs: {
|
|
|
273
309
|
};
|
|
274
310
|
};
|
|
275
311
|
'zh-Hans': {
|
|
312
|
+
lastUsed: string;
|
|
313
|
+
forgotPassword: string;
|
|
314
|
+
recoverAccount: string;
|
|
315
|
+
recoverDescription: string;
|
|
316
|
+
sendResetLink: string;
|
|
317
|
+
recoverySent: string;
|
|
318
|
+
recoverySentDescription: string;
|
|
319
|
+
addPasskey: string;
|
|
320
|
+
passkeyAdded: string;
|
|
276
321
|
signIn: string;
|
|
277
322
|
enterPassword: string;
|
|
278
323
|
createYourAccount: string;
|
|
@@ -341,6 +386,15 @@ export declare const catalogs: {
|
|
|
341
386
|
};
|
|
342
387
|
};
|
|
343
388
|
ja: {
|
|
389
|
+
lastUsed: string;
|
|
390
|
+
forgotPassword: string;
|
|
391
|
+
recoverAccount: string;
|
|
392
|
+
recoverDescription: string;
|
|
393
|
+
sendResetLink: string;
|
|
394
|
+
recoverySent: string;
|
|
395
|
+
recoverySentDescription: string;
|
|
396
|
+
addPasskey: string;
|
|
397
|
+
passkeyAdded: string;
|
|
344
398
|
signIn: string;
|
|
345
399
|
enterPassword: string;
|
|
346
400
|
createYourAccount: string;
|
|
@@ -409,6 +463,169 @@ export declare const catalogs: {
|
|
|
409
463
|
};
|
|
410
464
|
};
|
|
411
465
|
ko: {
|
|
466
|
+
lastUsed: string;
|
|
467
|
+
forgotPassword: string;
|
|
468
|
+
recoverAccount: string;
|
|
469
|
+
recoverDescription: string;
|
|
470
|
+
sendResetLink: string;
|
|
471
|
+
recoverySent: string;
|
|
472
|
+
recoverySentDescription: string;
|
|
473
|
+
addPasskey: string;
|
|
474
|
+
passkeyAdded: string;
|
|
475
|
+
signIn: string;
|
|
476
|
+
enterPassword: string;
|
|
477
|
+
createYourAccount: string;
|
|
478
|
+
checkInbox: string;
|
|
479
|
+
confirmEmail: string;
|
|
480
|
+
verifyIdentity: string;
|
|
481
|
+
chooseMethod: string;
|
|
482
|
+
startWithEmail: string;
|
|
483
|
+
checkEmailDescription: string;
|
|
484
|
+
confirmEmailDescription: string;
|
|
485
|
+
enterEmailCode: (email: string) => string;
|
|
486
|
+
enterRecovery: string;
|
|
487
|
+
enterAuthenticator: string;
|
|
488
|
+
loading: string;
|
|
489
|
+
retry: string;
|
|
490
|
+
openingProvider: (provider: string) => string;
|
|
491
|
+
continueProvider: (provider: string) => string;
|
|
492
|
+
orEmail: string;
|
|
493
|
+
email: string;
|
|
494
|
+
sendingCode: string;
|
|
495
|
+
emailCodeAction: string;
|
|
496
|
+
continueEmail: string;
|
|
497
|
+
waitingPasskey: string;
|
|
498
|
+
usePasskey: string;
|
|
499
|
+
newHere: string;
|
|
500
|
+
createAnAccount: string;
|
|
501
|
+
noMethods: string;
|
|
502
|
+
password: string;
|
|
503
|
+
hidePassword: string;
|
|
504
|
+
showPassword: string;
|
|
505
|
+
hide: string;
|
|
506
|
+
show: string;
|
|
507
|
+
minimumPassword: string;
|
|
508
|
+
working: string;
|
|
509
|
+
createAccount: string;
|
|
510
|
+
confirmAndSignIn: string;
|
|
511
|
+
changeEmailOrMethod: string;
|
|
512
|
+
backToSignIn: string;
|
|
513
|
+
emailCode: string;
|
|
514
|
+
checkingCode: string;
|
|
515
|
+
verifyCode: string;
|
|
516
|
+
resendIn: (duration: string) => string;
|
|
517
|
+
resendCode: string;
|
|
518
|
+
changeEmail: string;
|
|
519
|
+
usePassword: string;
|
|
520
|
+
recoveryCode: string;
|
|
521
|
+
authenticatorCode: string;
|
|
522
|
+
verifyAndSignIn: string;
|
|
523
|
+
useAuthenticator: string;
|
|
524
|
+
useRecovery: string;
|
|
525
|
+
language: string;
|
|
526
|
+
errors: {
|
|
527
|
+
signin: string;
|
|
528
|
+
cancelled: string;
|
|
529
|
+
use_existing: string;
|
|
530
|
+
invalid_credentials: string;
|
|
531
|
+
acceptance_required: string;
|
|
532
|
+
verify_email: string;
|
|
533
|
+
verification_failed: string;
|
|
534
|
+
invalid_code: string;
|
|
535
|
+
method_unavailable: string;
|
|
536
|
+
signup_failed: string;
|
|
537
|
+
invalid_input: string;
|
|
538
|
+
try_later: string;
|
|
539
|
+
unavailable: string;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
es: {
|
|
543
|
+
lastUsed: string;
|
|
544
|
+
forgotPassword: string;
|
|
545
|
+
recoverAccount: string;
|
|
546
|
+
recoverDescription: string;
|
|
547
|
+
sendResetLink: string;
|
|
548
|
+
recoverySent: string;
|
|
549
|
+
recoverySentDescription: string;
|
|
550
|
+
addPasskey: string;
|
|
551
|
+
passkeyAdded: string;
|
|
552
|
+
signIn: string;
|
|
553
|
+
enterPassword: string;
|
|
554
|
+
createYourAccount: string;
|
|
555
|
+
checkInbox: string;
|
|
556
|
+
confirmEmail: string;
|
|
557
|
+
verifyIdentity: string;
|
|
558
|
+
chooseMethod: string;
|
|
559
|
+
startWithEmail: string;
|
|
560
|
+
checkEmailDescription: string;
|
|
561
|
+
confirmEmailDescription: string;
|
|
562
|
+
enterEmailCode: (email: string) => string;
|
|
563
|
+
enterRecovery: string;
|
|
564
|
+
enterAuthenticator: string;
|
|
565
|
+
loading: string;
|
|
566
|
+
retry: string;
|
|
567
|
+
openingProvider: (provider: string) => string;
|
|
568
|
+
continueProvider: (provider: string) => string;
|
|
569
|
+
orEmail: string;
|
|
570
|
+
email: string;
|
|
571
|
+
sendingCode: string;
|
|
572
|
+
emailCodeAction: string;
|
|
573
|
+
continueEmail: string;
|
|
574
|
+
waitingPasskey: string;
|
|
575
|
+
usePasskey: string;
|
|
576
|
+
newHere: string;
|
|
577
|
+
createAnAccount: string;
|
|
578
|
+
noMethods: string;
|
|
579
|
+
password: string;
|
|
580
|
+
hidePassword: string;
|
|
581
|
+
showPassword: string;
|
|
582
|
+
hide: string;
|
|
583
|
+
show: string;
|
|
584
|
+
minimumPassword: string;
|
|
585
|
+
working: string;
|
|
586
|
+
createAccount: string;
|
|
587
|
+
confirmAndSignIn: string;
|
|
588
|
+
changeEmailOrMethod: string;
|
|
589
|
+
backToSignIn: string;
|
|
590
|
+
emailCode: string;
|
|
591
|
+
checkingCode: string;
|
|
592
|
+
verifyCode: string;
|
|
593
|
+
resendIn: (duration: string) => string;
|
|
594
|
+
resendCode: string;
|
|
595
|
+
changeEmail: string;
|
|
596
|
+
usePassword: string;
|
|
597
|
+
recoveryCode: string;
|
|
598
|
+
authenticatorCode: string;
|
|
599
|
+
verifyAndSignIn: string;
|
|
600
|
+
useAuthenticator: string;
|
|
601
|
+
useRecovery: string;
|
|
602
|
+
language: string;
|
|
603
|
+
errors: {
|
|
604
|
+
signin: string;
|
|
605
|
+
cancelled: string;
|
|
606
|
+
use_existing: string;
|
|
607
|
+
invalid_credentials: string;
|
|
608
|
+
acceptance_required: string;
|
|
609
|
+
verify_email: string;
|
|
610
|
+
verification_failed: string;
|
|
611
|
+
invalid_code: string;
|
|
612
|
+
method_unavailable: string;
|
|
613
|
+
signup_failed: string;
|
|
614
|
+
invalid_input: string;
|
|
615
|
+
try_later: string;
|
|
616
|
+
unavailable: string;
|
|
617
|
+
};
|
|
618
|
+
};
|
|
619
|
+
'pt-BR': {
|
|
620
|
+
lastUsed: string;
|
|
621
|
+
forgotPassword: string;
|
|
622
|
+
recoverAccount: string;
|
|
623
|
+
recoverDescription: string;
|
|
624
|
+
sendResetLink: string;
|
|
625
|
+
recoverySent: string;
|
|
626
|
+
recoverySentDescription: string;
|
|
627
|
+
addPasskey: string;
|
|
628
|
+
passkeyAdded: string;
|
|
412
629
|
signIn: string;
|
|
413
630
|
enterPassword: string;
|
|
414
631
|
createYourAccount: string;
|
|
@@ -485,4 +702,10 @@ export declare const localeNames: {
|
|
|
485
702
|
'zh-Hans': string;
|
|
486
703
|
ja: string;
|
|
487
704
|
ko: string;
|
|
705
|
+
es: string;
|
|
706
|
+
'pt-BR': string;
|
|
707
|
+
};
|
|
708
|
+
export type SignInMessagesOverride = Partial<Omit<SignInMessages, 'errors'>> & {
|
|
709
|
+
errors?: Partial<SignInMessages['errors']>;
|
|
488
710
|
};
|
|
711
|
+
export declare function resolveSignInMessages(locale: AuthLocale, messages?: SignInMessagesOverride): SignInMessages;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type SignInMessagesOverride } from './messages.js';
|
|
2
|
+
export type SylphxPasskeyEnrollProps = {
|
|
3
|
+
/** Enable only for a signed-in view, when discovery advertises passkeyEnrollment. */
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
routePrefix?: string;
|
|
6
|
+
locale?: string;
|
|
7
|
+
messages?: SignInMessagesOverride;
|
|
8
|
+
class?: string;
|
|
9
|
+
};
|
|
10
|
+
/** Add a discoverable passkey to the current account. Never takes identity or tokens from the UI. */
|
|
11
|
+
export declare function SylphxPasskeyEnroll(props: SylphxPasskeyEnrollProps): import("solid-js").JSX.Element;
|