@sylphx/auth-solid 0.1.1 → 0.1.3
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 +42 -2
- package/dist/browser.js +888 -380
- 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 +230 -0
- package/dist/passkey-enroll.d.ts +11 -0
- package/dist/server.js +605 -151
- package/dist/sign-in-controller.d.ts +22 -21
- 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/server.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey, ssrStyle } from "solid-js/web";
|
|
2
|
-
import { providerDestination, providers, safeReturnTo } from "@sylphx/auth/client";
|
|
3
|
-
import { For, Match, Show, Switch, createMemo, createSignal, createUniqueId, onCleanup, onMount } from "solid-js";
|
|
2
|
+
import { authRoutePrefix, providerDestination, providers, safeReturnTo } from "@sylphx/auth/client";
|
|
3
|
+
import { For, Match, Show, Switch, createEffect, createMemo, createSignal, createUniqueId, onCleanup, onMount } from "solid-js";
|
|
4
4
|
// src/messages.ts
|
|
5
5
|
var catalogs = {
|
|
6
6
|
en: {
|
|
7
|
+
lastUsed: "Last used",
|
|
8
|
+
forgotPassword: "Forgot your password?",
|
|
9
|
+
recoverAccount: "Reset your password",
|
|
10
|
+
recoverDescription: "Enter the email address for your account.",
|
|
11
|
+
sendResetLink: "Send reset link",
|
|
12
|
+
recoverySent: "Check your inbox",
|
|
13
|
+
recoverySentDescription: "If an account exists for this address, you’ll receive a password reset link.",
|
|
14
|
+
addPasskey: "Add a passkey",
|
|
15
|
+
passkeyAdded: "Passkey added",
|
|
7
16
|
signIn: "Sign in",
|
|
8
17
|
enterPassword: "Enter your password",
|
|
9
18
|
createYourAccount: "Create your account",
|
|
@@ -60,6 +69,7 @@ var catalogs = {
|
|
|
60
69
|
cancelled: "Sign-in was canceled. You can try again whenever you’re ready.",
|
|
61
70
|
use_existing: "Try the method you originally used to sign in. This provider couldn’t confirm your email.",
|
|
62
71
|
invalid_credentials: "That email and password didn’t match. Check both and try again.",
|
|
72
|
+
acceptance_required: "Accept the current terms to continue.",
|
|
63
73
|
verify_email: "Confirm your email from the link in your inbox before signing in.",
|
|
64
74
|
verification_failed: "This confirmation link couldn’t be used. Check that you opened the latest link.",
|
|
65
75
|
invalid_code: "That code didn’t work. Check it and try again.",
|
|
@@ -71,6 +81,15 @@ var catalogs = {
|
|
|
71
81
|
}
|
|
72
82
|
},
|
|
73
83
|
"zh-Hant-HK": {
|
|
84
|
+
lastUsed: "上次使用",
|
|
85
|
+
forgotPassword: "忘記密碼?",
|
|
86
|
+
recoverAccount: "重設密碼",
|
|
87
|
+
recoverDescription: "請輸入帳戶的電郵地址。",
|
|
88
|
+
sendResetLink: "傳送重設連結",
|
|
89
|
+
recoverySent: "查閱收件箱",
|
|
90
|
+
recoverySentDescription: "如這個電郵地址已連結帳戶,你將收到密碼重設連結。",
|
|
91
|
+
addPasskey: "新增通行密鑰",
|
|
92
|
+
passkeyAdded: "已新增通行密鑰",
|
|
74
93
|
signIn: "登入",
|
|
75
94
|
enterPassword: "輸入密碼",
|
|
76
95
|
createYourAccount: "建立帳戶",
|
|
@@ -127,6 +146,7 @@ var catalogs = {
|
|
|
127
146
|
cancelled: "登入已取消。你可以隨時再試。",
|
|
128
147
|
use_existing: "這項登入服務未能確認你的電郵地址。請改用原來的登入方式。",
|
|
129
148
|
invalid_credentials: "電郵地址與密碼不符。請核對後再試。",
|
|
149
|
+
acceptance_required: "請同意現行條款後繼續。",
|
|
130
150
|
verify_email: "請先開啟確認電郵內的連結,確認電郵地址後再登入。",
|
|
131
151
|
verification_failed: "此連結無法使用。請開啟最新一封確認電郵內的連結。",
|
|
132
152
|
invalid_code: "驗證碼無法使用。請核對後再試。",
|
|
@@ -138,6 +158,15 @@ var catalogs = {
|
|
|
138
158
|
}
|
|
139
159
|
},
|
|
140
160
|
"zh-Hant-TW": {
|
|
161
|
+
lastUsed: "上次使用",
|
|
162
|
+
forgotPassword: "忘記密碼?",
|
|
163
|
+
recoverAccount: "重設密碼",
|
|
164
|
+
recoverDescription: "請輸入帳戶的電子郵件地址。",
|
|
165
|
+
sendResetLink: "傳送重設連結",
|
|
166
|
+
recoverySent: "查看收件匣",
|
|
167
|
+
recoverySentDescription: "如果這個電子郵件地址已連結帳戶,你會收到密碼重設連結。",
|
|
168
|
+
addPasskey: "新增通行密鑰",
|
|
169
|
+
passkeyAdded: "已新增通行密鑰",
|
|
141
170
|
signIn: "登入",
|
|
142
171
|
enterPassword: "輸入密碼",
|
|
143
172
|
createYourAccount: "建立帳號",
|
|
@@ -194,6 +223,7 @@ var catalogs = {
|
|
|
194
223
|
cancelled: "登入已取消。你可以隨時再試。",
|
|
195
224
|
use_existing: "這項登入服務無法確認你的電子郵件地址。請改用原本的登入方式。",
|
|
196
225
|
invalid_credentials: "電子郵件地址和密碼不符。請檢查後再試一次。",
|
|
226
|
+
acceptance_required: "請同意目前的條款後繼續。",
|
|
197
227
|
verify_email: "請先開啟確認信中的連結,確認電子郵件地址後再登入。",
|
|
198
228
|
verification_failed: "這個確認連結無法使用。請確認你開啟的是最新一封確認信中的連結。",
|
|
199
229
|
invalid_code: "這組驗證碼無法使用。請檢查後再試一次。",
|
|
@@ -205,6 +235,15 @@ var catalogs = {
|
|
|
205
235
|
}
|
|
206
236
|
},
|
|
207
237
|
"zh-Hans": {
|
|
238
|
+
lastUsed: "上次使用",
|
|
239
|
+
forgotPassword: "忘记密码?",
|
|
240
|
+
recoverAccount: "重置密码",
|
|
241
|
+
recoverDescription: "请输入账户的电子邮箱。",
|
|
242
|
+
sendResetLink: "发送重置链接",
|
|
243
|
+
recoverySent: "查看收件箱",
|
|
244
|
+
recoverySentDescription: "如果此邮箱关联了账户,你将收到密码重置链接。",
|
|
245
|
+
addPasskey: "添加通行密钥",
|
|
246
|
+
passkeyAdded: "已添加通行密钥",
|
|
208
247
|
signIn: "登录",
|
|
209
248
|
enterPassword: "输入密码",
|
|
210
249
|
createYourAccount: "创建账号",
|
|
@@ -261,6 +300,7 @@ var catalogs = {
|
|
|
261
300
|
cancelled: "登录已取消。你可以随时重试。",
|
|
262
301
|
use_existing: "此登录服务无法确认你的邮箱地址。请改用原来的登录方式。",
|
|
263
302
|
invalid_credentials: "邮箱地址和密码不匹配。请检查后重试。",
|
|
303
|
+
acceptance_required: "请同意当前条款后继续。",
|
|
264
304
|
verify_email: "请先打开确认邮件中的链接,确认邮箱地址后再登录。",
|
|
265
305
|
verification_failed: "此链接无法使用。请打开最新一封确认邮件中的链接。",
|
|
266
306
|
invalid_code: "此验证码无法使用。请检查后重试。",
|
|
@@ -272,6 +312,15 @@ var catalogs = {
|
|
|
272
312
|
}
|
|
273
313
|
},
|
|
274
314
|
ja: {
|
|
315
|
+
lastUsed: "前回使用",
|
|
316
|
+
forgotPassword: "パスワードをお忘れですか?",
|
|
317
|
+
recoverAccount: "パスワードを再設定",
|
|
318
|
+
recoverDescription: "アカウントのメールアドレスを入力してください。",
|
|
319
|
+
sendResetLink: "再設定リンクを送信",
|
|
320
|
+
recoverySent: "メールを確認",
|
|
321
|
+
recoverySentDescription: "該当するアカウントがある場合、再設定リンクが届きます。",
|
|
322
|
+
addPasskey: "パスキーを追加",
|
|
323
|
+
passkeyAdded: "パスキーを追加しました",
|
|
275
324
|
signIn: "ログイン",
|
|
276
325
|
enterPassword: "パスワードを入力",
|
|
277
326
|
createYourAccount: "アカウントを作成",
|
|
@@ -328,6 +377,7 @@ var catalogs = {
|
|
|
328
377
|
cancelled: "ログインがキャンセルされました。いつでもやり直せます。",
|
|
329
378
|
use_existing: "このサービスではメールアドレスを確認できませんでした。最初に使った方法でログインしてください。",
|
|
330
379
|
invalid_credentials: "メールアドレスとパスワードが一致しません。両方を確認して、もう一度お試しください。",
|
|
380
|
+
acceptance_required: "続行するには、現在の利用規約に同意してください。",
|
|
331
381
|
verify_email: "確認メール内のリンクを開き、メールアドレスを確認してからログインしてください。",
|
|
332
382
|
verification_failed: "この確認リンクは使えません。最新の確認メールのリンクをお試しください。",
|
|
333
383
|
invalid_code: "このコードは使えません。入力内容を確認して、もう一度お試しください。",
|
|
@@ -339,6 +389,15 @@ var catalogs = {
|
|
|
339
389
|
}
|
|
340
390
|
},
|
|
341
391
|
ko: {
|
|
392
|
+
lastUsed: "최근 사용",
|
|
393
|
+
forgotPassword: "비밀번호를 잊으셨나요?",
|
|
394
|
+
recoverAccount: "비밀번호 재설정",
|
|
395
|
+
recoverDescription: "계정의 이메일 주소를 입력하세요.",
|
|
396
|
+
sendResetLink: "재설정 링크 보내기",
|
|
397
|
+
recoverySent: "받은편지함을 확인하세요",
|
|
398
|
+
recoverySentDescription: "이 주소에 연결된 계정이 있다면 비밀번호 재설정 링크가 전송됩니다.",
|
|
399
|
+
addPasskey: "패스키 추가",
|
|
400
|
+
passkeyAdded: "패스키가 추가되었습니다",
|
|
342
401
|
signIn: "로그인",
|
|
343
402
|
enterPassword: "비밀번호를 입력하세요",
|
|
344
403
|
createYourAccount: "계정 만들기",
|
|
@@ -395,6 +454,7 @@ var catalogs = {
|
|
|
395
454
|
cancelled: "로그인이 취소되었습니다. 언제든지 다시 시도할 수 있습니다.",
|
|
396
455
|
use_existing: "이 로그인 서비스에서 이메일 주소를 확인할 수 없습니다. 처음 사용한 방법으로 로그인하세요.",
|
|
397
456
|
invalid_credentials: "이메일 주소 또는 비밀번호가 올바르지 않습니다. 확인한 뒤 다시 시도하세요.",
|
|
457
|
+
acceptance_required: "계속하려면 현재 약관에 동의하세요.",
|
|
398
458
|
verify_email: "로그인하기 전에 받은 이메일의 링크를 열어 이메일 주소를 확인하세요.",
|
|
399
459
|
verification_failed: "이 확인 링크를 사용할 수 없습니다. 가장 최근에 받은 링크를 열어 보세요.",
|
|
400
460
|
invalid_code: "인증 코드가 올바르지 않습니다. 코드를 확인한 뒤 다시 시도하세요.",
|
|
@@ -404,6 +464,160 @@ var catalogs = {
|
|
|
404
464
|
try_later: "시도 횟수가 너무 많습니다. 잠시 후 다시 시도하세요.",
|
|
405
465
|
unavailable: "연결하지 못했습니다. 잠시 후 다시 시도하세요."
|
|
406
466
|
}
|
|
467
|
+
},
|
|
468
|
+
es: {
|
|
469
|
+
lastUsed: "Último método usado",
|
|
470
|
+
forgotPassword: "¿Olvidaste tu contraseña?",
|
|
471
|
+
recoverAccount: "Restablece tu contraseña",
|
|
472
|
+
recoverDescription: "Introduce el correo de tu cuenta.",
|
|
473
|
+
sendResetLink: "Enviar enlace de recuperación",
|
|
474
|
+
recoverySent: "Revisa tu bandeja de entrada",
|
|
475
|
+
recoverySentDescription: "Si hay una cuenta asociada a este correo, recibirás un enlace para restablecer la contraseña.",
|
|
476
|
+
addPasskey: "Añadir una llave de acceso",
|
|
477
|
+
passkeyAdded: "Llave de acceso añadida",
|
|
478
|
+
signIn: "Inicia sesión",
|
|
479
|
+
enterPassword: "Introduce tu contraseña",
|
|
480
|
+
createYourAccount: "Crea tu cuenta",
|
|
481
|
+
checkInbox: "Revisa tu bandeja de entrada",
|
|
482
|
+
confirmEmail: "Confirma tu correo electrónico",
|
|
483
|
+
verifyIdentity: "Verifica tu identidad",
|
|
484
|
+
chooseMethod: "Elige cómo quieres iniciar sesión.",
|
|
485
|
+
startWithEmail: "Usa tu correo electrónico para empezar.",
|
|
486
|
+
checkEmailDescription: "Si esta dirección es nueva, te enviaremos un enlace de confirmación. Ábrelo e introduce la contraseña que elegiste.",
|
|
487
|
+
confirmEmailDescription: "Introduce el correo y la contraseña que usaste para registrarte.",
|
|
488
|
+
enterEmailCode: (email) => `Introduce el código de seis dígitos que enviamos a ${email}.`,
|
|
489
|
+
enterRecovery: "Introduce uno de tus códigos de recuperación guardados.",
|
|
490
|
+
enterAuthenticator: "Introduce el código de tu aplicación de autenticación.",
|
|
491
|
+
loading: "Cargando opciones de acceso…",
|
|
492
|
+
retry: "Volver a intentar",
|
|
493
|
+
openingProvider: (provider) => `Abriendo ${provider}…`,
|
|
494
|
+
continueProvider: (provider) => `Continuar con ${provider}`,
|
|
495
|
+
orEmail: "o usa tu correo electrónico",
|
|
496
|
+
email: "Correo electrónico",
|
|
497
|
+
sendingCode: "Enviando el código…",
|
|
498
|
+
emailCodeAction: "Enviarme un código",
|
|
499
|
+
continueEmail: "Continuar con correo electrónico",
|
|
500
|
+
waitingPasskey: "Esperando tu llave de acceso…",
|
|
501
|
+
usePasskey: "Usar una llave de acceso",
|
|
502
|
+
newHere: "¿No tienes cuenta?",
|
|
503
|
+
createAnAccount: "Crea una cuenta",
|
|
504
|
+
noMethods: "No hay métodos de inicio de sesión disponibles ahora.",
|
|
505
|
+
password: "Contraseña",
|
|
506
|
+
hidePassword: "Ocultar contraseña",
|
|
507
|
+
showPassword: "Mostrar contraseña",
|
|
508
|
+
hide: "Ocultar",
|
|
509
|
+
show: "Mostrar",
|
|
510
|
+
minimumPassword: "Usa al menos 12 caracteres.",
|
|
511
|
+
working: "Un momento…",
|
|
512
|
+
createAccount: "Crear cuenta",
|
|
513
|
+
confirmAndSignIn: "Confirmar e iniciar sesión",
|
|
514
|
+
changeEmailOrMethod: "Cambiar de correo o método de acceso",
|
|
515
|
+
backToSignIn: "Volver al inicio de sesión",
|
|
516
|
+
emailCode: "Código de correo electrónico",
|
|
517
|
+
checkingCode: "Comprobando el código…",
|
|
518
|
+
verifyCode: "Verificar código",
|
|
519
|
+
resendIn: (duration) => `Reenviar en ${duration}`,
|
|
520
|
+
resendCode: "Reenviar código",
|
|
521
|
+
changeEmail: "Cambiar de correo",
|
|
522
|
+
usePassword: "Usar contraseña",
|
|
523
|
+
recoveryCode: "Código de recuperación",
|
|
524
|
+
authenticatorCode: "Código de autenticación",
|
|
525
|
+
verifyAndSignIn: "Verificar e iniciar sesión",
|
|
526
|
+
useAuthenticator: "Usar la aplicación de autenticación",
|
|
527
|
+
useRecovery: "Usar un código de recuperación",
|
|
528
|
+
language: "Idioma",
|
|
529
|
+
errors: {
|
|
530
|
+
signin: "No se completó el inicio de sesión. Inténtalo de nuevo o elige otro método.",
|
|
531
|
+
cancelled: "Se canceló el inicio de sesión. Puedes volver a intentarlo cuando quieras.",
|
|
532
|
+
use_existing: "Usa el método con el que iniciaste sesión la primera vez. Este proveedor no pudo confirmar tu correo.",
|
|
533
|
+
invalid_credentials: "El correo y la contraseña no coinciden. Comprueba ambos e inténtalo de nuevo.",
|
|
534
|
+
acceptance_required: "Acepta las condiciones vigentes para continuar.",
|
|
535
|
+
verify_email: "Confirma tu correo con el enlace de tu bandeja de entrada antes de iniciar sesión.",
|
|
536
|
+
verification_failed: "No se pudo usar este enlace de confirmación. Comprueba que abriste el más reciente.",
|
|
537
|
+
invalid_code: "El código no es válido. Revísalo e inténtalo de nuevo.",
|
|
538
|
+
method_unavailable: "Este método no está disponible ahora. Prueba otro.",
|
|
539
|
+
signup_failed: "No pudimos iniciar el registro. Comprueba tus datos e inténtalo de nuevo.",
|
|
540
|
+
invalid_input: "Comprueba tus datos e inténtalo de nuevo.",
|
|
541
|
+
try_later: "Demasiados intentos. Espera un momento antes de volver a intentarlo.",
|
|
542
|
+
unavailable: "No pudimos conectarnos. Inténtalo de nuevo en un momento."
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"pt-BR": {
|
|
546
|
+
lastUsed: "Último método usado",
|
|
547
|
+
forgotPassword: "Esqueceu sua senha?",
|
|
548
|
+
recoverAccount: "Redefina sua senha",
|
|
549
|
+
recoverDescription: "Digite o e-mail da sua conta.",
|
|
550
|
+
sendResetLink: "Enviar link de redefinição",
|
|
551
|
+
recoverySent: "Confira sua caixa de entrada",
|
|
552
|
+
recoverySentDescription: "Se houver uma conta com esse e-mail, você receberá um link para redefinir a senha.",
|
|
553
|
+
addPasskey: "Adicionar uma chave de acesso",
|
|
554
|
+
passkeyAdded: "Chave de acesso adicionada",
|
|
555
|
+
signIn: "Entrar",
|
|
556
|
+
enterPassword: "Digite sua senha",
|
|
557
|
+
createYourAccount: "Crie sua conta",
|
|
558
|
+
checkInbox: "Confira sua caixa de entrada",
|
|
559
|
+
confirmEmail: "Confirme seu e-mail",
|
|
560
|
+
verifyIdentity: "Confirme que é você",
|
|
561
|
+
chooseMethod: "Escolha como você quer entrar.",
|
|
562
|
+
startWithEmail: "Use seu e-mail para começar.",
|
|
563
|
+
checkEmailDescription: "Se este endereço for novo, enviaremos um link de confirmação. Abra o link e digite a senha que você escolheu.",
|
|
564
|
+
confirmEmailDescription: "Digite o e-mail e a senha que você usou no cadastro.",
|
|
565
|
+
enterEmailCode: (email) => `Digite o código de seis dígitos que enviamos para ${email}.`,
|
|
566
|
+
enterRecovery: "Digite um dos códigos de recuperação que você guardou.",
|
|
567
|
+
enterAuthenticator: "Digite o código do seu aplicativo autenticador.",
|
|
568
|
+
loading: "Carregando opções de login…",
|
|
569
|
+
retry: "Tentar novamente",
|
|
570
|
+
openingProvider: (provider) => `Abrindo ${provider}…`,
|
|
571
|
+
continueProvider: (provider) => `Continuar com ${provider}`,
|
|
572
|
+
orEmail: "ou use seu e-mail",
|
|
573
|
+
email: "Endereço de e-mail",
|
|
574
|
+
sendingCode: "Enviando código…",
|
|
575
|
+
emailCodeAction: "Enviar um código por e-mail",
|
|
576
|
+
continueEmail: "Continuar com e-mail",
|
|
577
|
+
waitingPasskey: "Aguardando sua chave de acesso…",
|
|
578
|
+
usePasskey: "Usar uma chave de acesso",
|
|
579
|
+
newHere: "Ainda não tem conta?",
|
|
580
|
+
createAnAccount: "Crie uma conta",
|
|
581
|
+
noMethods: "Nenhum método de login está disponível no momento.",
|
|
582
|
+
password: "Senha",
|
|
583
|
+
hidePassword: "Ocultar senha",
|
|
584
|
+
showPassword: "Mostrar senha",
|
|
585
|
+
hide: "Ocultar",
|
|
586
|
+
show: "Mostrar",
|
|
587
|
+
minimumPassword: "Use pelo menos 12 caracteres.",
|
|
588
|
+
working: "Aguarde…",
|
|
589
|
+
createAccount: "Criar conta",
|
|
590
|
+
confirmAndSignIn: "Confirmar e entrar",
|
|
591
|
+
changeEmailOrMethod: "Trocar e-mail ou método de login",
|
|
592
|
+
backToSignIn: "Voltar para o login",
|
|
593
|
+
emailCode: "Código por e-mail",
|
|
594
|
+
checkingCode: "Verificando código…",
|
|
595
|
+
verifyCode: "Verificar código",
|
|
596
|
+
resendIn: (duration) => `Reenviar em ${duration}`,
|
|
597
|
+
resendCode: "Reenviar código",
|
|
598
|
+
changeEmail: "Trocar e-mail",
|
|
599
|
+
usePassword: "Usar senha",
|
|
600
|
+
recoveryCode: "Código de recuperação",
|
|
601
|
+
authenticatorCode: "Código do autenticador",
|
|
602
|
+
verifyAndSignIn: "Verificar e entrar",
|
|
603
|
+
useAuthenticator: "Usar o aplicativo autenticador",
|
|
604
|
+
useRecovery: "Usar um código de recuperação",
|
|
605
|
+
language: "Idioma",
|
|
606
|
+
errors: {
|
|
607
|
+
signin: "Não foi possível concluir o login. Tente novamente ou escolha outro método.",
|
|
608
|
+
cancelled: "O login foi cancelado. Você pode tentar novamente quando quiser.",
|
|
609
|
+
use_existing: "Use o método com o qual você entrou pela primeira vez. Este provedor não conseguiu confirmar seu e-mail.",
|
|
610
|
+
invalid_credentials: "O e-mail e a senha não correspondem. Confira os dois e tente novamente.",
|
|
611
|
+
acceptance_required: "Aceite os termos atuais para continuar.",
|
|
612
|
+
verify_email: "Antes de entrar, confirme seu e-mail pelo link na sua caixa de entrada.",
|
|
613
|
+
verification_failed: "Não foi possível usar este link de confirmação. Confira se você abriu o mais recente.",
|
|
614
|
+
invalid_code: "O código não funcionou. Confira e tente novamente.",
|
|
615
|
+
method_unavailable: "Este método de login não está disponível no momento. Tente outro.",
|
|
616
|
+
signup_failed: "Não foi possível iniciar o cadastro. Confira seus dados e tente novamente.",
|
|
617
|
+
invalid_input: "Confira seus dados e tente novamente.",
|
|
618
|
+
try_later: "Muitas tentativas. Aguarde um momento e tente novamente.",
|
|
619
|
+
unavailable: "Não foi possível conectar. Tente novamente em instantes."
|
|
620
|
+
}
|
|
407
621
|
}
|
|
408
622
|
};
|
|
409
623
|
var localeNames = {
|
|
@@ -412,8 +626,21 @@ var localeNames = {
|
|
|
412
626
|
"zh-Hant-TW": "繁體中文(台灣)",
|
|
413
627
|
"zh-Hans": "简体中文",
|
|
414
628
|
ja: "日本語",
|
|
415
|
-
ko: "한국어"
|
|
629
|
+
ko: "한국어",
|
|
630
|
+
es: "Español",
|
|
631
|
+
"pt-BR": "Português (Brasil)"
|
|
416
632
|
};
|
|
633
|
+
function resolveSignInMessages(locale, messages) {
|
|
634
|
+
const base = catalogs[locale];
|
|
635
|
+
return messages ? {
|
|
636
|
+
...base,
|
|
637
|
+
...messages,
|
|
638
|
+
errors: {
|
|
639
|
+
...base.errors,
|
|
640
|
+
...messages.errors
|
|
641
|
+
}
|
|
642
|
+
} : base;
|
|
643
|
+
}
|
|
417
644
|
/** Select a shipped language without comparing raw locale strings or relying on the host's locale. */
|
|
418
645
|
function resolveAuthLocale(preferences) {
|
|
419
646
|
for (const preference of preferences) {
|
|
@@ -424,7 +651,7 @@ function resolveAuthLocale(preferences) {
|
|
|
424
651
|
continue;
|
|
425
652
|
}
|
|
426
653
|
if (Object.hasOwn(catalogs, locale.baseName)) return locale.baseName;
|
|
427
|
-
if (locale.language === "en" || locale.language === "ja" || locale.language === "ko") return locale.language;
|
|
654
|
+
if (locale.language === "en" || locale.language === "ja" || locale.language === "ko" || locale.language === "es") return locale.language;
|
|
428
655
|
if (locale.language === "zh") {
|
|
429
656
|
const script = locale.maximize().script;
|
|
430
657
|
if (script === "Hans") return "zh-Hans";
|
|
@@ -441,6 +668,105 @@ function authSecondsFormat(locale) {
|
|
|
441
668
|
unitDisplay: "short"
|
|
442
669
|
});
|
|
443
670
|
}
|
|
671
|
+
// src/sign-in-messages.ts
|
|
672
|
+
/** Use the host's explicit language tag when the host also provides its copy. */
|
|
673
|
+
function signInLanguage(fallback, locale, messages) {
|
|
674
|
+
if (locale !== void 0 && messages !== void 0) try {
|
|
675
|
+
return new Intl.Locale(locale).toString();
|
|
676
|
+
} catch {}
|
|
677
|
+
return fallback;
|
|
678
|
+
}
|
|
679
|
+
// src/sign-in-request.ts
|
|
680
|
+
var errors$1 = catalogs.en.errors;
|
|
681
|
+
errors$1.unavailable;
|
|
682
|
+
function isErrorCode(value) {
|
|
683
|
+
return typeof value === "string" && Object.hasOwn(errors$1, value);
|
|
684
|
+
}
|
|
685
|
+
var SignInError = class extends Error {
|
|
686
|
+
code;
|
|
687
|
+
constructor(code) {
|
|
688
|
+
super(code);
|
|
689
|
+
this.code = code;
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
async function postAuthJSON(path, body, signal) {
|
|
693
|
+
signal.throwIfAborted();
|
|
694
|
+
const res = await fetch(path, {
|
|
695
|
+
method: "POST",
|
|
696
|
+
headers: { "Content-Type": "application/json" },
|
|
697
|
+
credentials: "same-origin",
|
|
698
|
+
referrerPolicy: "origin",
|
|
699
|
+
redirect: "error",
|
|
700
|
+
signal: AbortSignal.any([signal, AbortSignal.timeout(45e3)]),
|
|
701
|
+
body: JSON.stringify(body)
|
|
702
|
+
});
|
|
703
|
+
const data = await res.json();
|
|
704
|
+
if (!res.ok) {
|
|
705
|
+
const code = data && typeof data === "object" && "error" in data ? data.error : void 0;
|
|
706
|
+
throw new SignInError(isErrorCode(code) ? code : "unavailable");
|
|
707
|
+
}
|
|
708
|
+
return data;
|
|
709
|
+
}
|
|
710
|
+
// src/sign-in-webauthn.ts
|
|
711
|
+
function decodeBase64Url(value) {
|
|
712
|
+
return Uint8Array.from(atob(value.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0));
|
|
713
|
+
}
|
|
714
|
+
function encodeBase64Url(value) {
|
|
715
|
+
return btoa(Array.from(new Uint8Array(value), (byte) => String.fromCharCode(byte)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
716
|
+
}
|
|
717
|
+
// src/passkey-enroll.tsx
|
|
718
|
+
var _tmpl$$2 = [
|
|
719
|
+
"<output",
|
|
720
|
+
">",
|
|
721
|
+
"</output>"
|
|
722
|
+
];
|
|
723
|
+
var _tmpl$2$2 = [
|
|
724
|
+
"<div",
|
|
725
|
+
"><button type=\"button\"",
|
|
726
|
+
"",
|
|
727
|
+
">",
|
|
728
|
+
"</button><!--$-->",
|
|
729
|
+
"<!--/--><!--$-->",
|
|
730
|
+
"<!--/--></div>"
|
|
731
|
+
];
|
|
732
|
+
var _tmpl$3$2 = [
|
|
733
|
+
"<p",
|
|
734
|
+
" role=\"alert\">",
|
|
735
|
+
"</p>"
|
|
736
|
+
];
|
|
737
|
+
/** Add a discoverable passkey to the current account. Never takes identity or tokens from the UI. */
|
|
738
|
+
function SylphxPasskeyEnroll(props) {
|
|
739
|
+
`${authRoutePrefix(props.routePrefix)}`;
|
|
740
|
+
const owner = new AbortController();
|
|
741
|
+
const [supported, setSupported] = createSignal(false);
|
|
742
|
+
const [busy, setBusy] = createSignal(false);
|
|
743
|
+
const [added, setAdded] = createSignal(false);
|
|
744
|
+
const [error, setError] = createSignal();
|
|
745
|
+
const locale = () => resolveAuthLocale(props.locale ? [props.locale] : []);
|
|
746
|
+
const text = createMemo(() => resolveSignInMessages(locale(), props.messages));
|
|
747
|
+
onMount(() => setSupported(window.isSecureContext && typeof PublicKeyCredential !== "undefined"));
|
|
748
|
+
onCleanup(() => owner.abort());
|
|
749
|
+
return createComponent(Show, {
|
|
750
|
+
get when() {
|
|
751
|
+
return memo(() => !!supported())() && props.enabled;
|
|
752
|
+
},
|
|
753
|
+
get children() {
|
|
754
|
+
return ssr(_tmpl$2$2, ssrHydrationKey() + ssrAttribute("lang", escape(signInLanguage(locale(), props.locale, props.messages), true), false), ssrAttribute("class", escape(props.class ?? "auth-sign-in-secondary", true), false), ssrAttribute("disabled", busy(), true), busy() ? escape(text().working) : escape(text().addPasskey), escape(createComponent(Show, {
|
|
755
|
+
get when() {
|
|
756
|
+
return error();
|
|
757
|
+
},
|
|
758
|
+
children: (code) => ssr(_tmpl$3$2, ssrHydrationKey(), escape(text().errors[code()]))
|
|
759
|
+
})), escape(createComponent(Show, {
|
|
760
|
+
get when() {
|
|
761
|
+
return added();
|
|
762
|
+
},
|
|
763
|
+
get children() {
|
|
764
|
+
return ssr(_tmpl$$2, ssrHydrationKey(), escape(text().passkeyAdded));
|
|
765
|
+
}
|
|
766
|
+
})));
|
|
767
|
+
}
|
|
768
|
+
});
|
|
769
|
+
}
|
|
444
770
|
// src/provider-icons.tsx
|
|
445
771
|
var _tmpl$$1 = ["<svg", " aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"19\" height=\"19\"><path d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\" fill=\"#4285F4\"></path><path d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\" fill=\"#34A853\"></path><path d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\" fill=\"#FBBC05\"></path><path d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\" fill=\"#EA4335\"></path></svg>"];
|
|
446
772
|
var _tmpl$2$1 = ["<svg", " aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"currentColor\" width=\"19\" height=\"19\"><path d=\"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z\"></path></svg>"];
|
|
@@ -464,32 +790,16 @@ function FacebookIcon() {
|
|
|
464
790
|
}
|
|
465
791
|
// src/sign-in-controller.ts
|
|
466
792
|
var errors = catalogs.en.errors;
|
|
467
|
-
errors.unavailable;
|
|
468
|
-
function isErrorCode(value) {
|
|
469
|
-
return typeof value === "string" && Object.hasOwn(errors, value);
|
|
470
|
-
}
|
|
471
|
-
var SignInError = class extends Error {
|
|
472
|
-
code;
|
|
473
|
-
constructor(code) {
|
|
474
|
-
super(code);
|
|
475
|
-
this.code = code;
|
|
476
|
-
}
|
|
477
|
-
};
|
|
478
|
-
function decode(value) {
|
|
479
|
-
return Uint8Array.from(atob(value.replace(/-/g, "+").replace(/_/g, "/")), (c) => c.charCodeAt(0));
|
|
480
|
-
}
|
|
481
|
-
function encode(value) {
|
|
482
|
-
return btoa(String.fromCharCode(...new Uint8Array(value))).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
483
|
-
}
|
|
484
793
|
/** Create under a Solid owner. Requests start on mount and abort on cleanup. */
|
|
485
794
|
function createSignInController(options) {
|
|
486
795
|
const search = new URLSearchParams(options.search);
|
|
487
796
|
const next = safeReturnTo(options.next);
|
|
797
|
+
const route = authRoutePrefix(options.routePrefix);
|
|
488
798
|
const loginPath = safeReturnTo(options.loginPath, "/login").split(/[?#]/, 1)[0];
|
|
489
799
|
const challengeId = search.get("challenge_id");
|
|
490
800
|
const verification = search.get("token");
|
|
491
801
|
const hasVerification = !!challengeId && !!verification && search.get("type") === "email_verification";
|
|
492
|
-
const [config, setConfig] = createSignal();
|
|
802
|
+
const [config, setConfig] = createSignal(options.initialConfig);
|
|
493
803
|
const [configFailed, setConfigFailed] = createSignal(false);
|
|
494
804
|
const [step, setStep] = createSignal("choose");
|
|
495
805
|
const [email, setEmail] = createSignal("");
|
|
@@ -500,8 +810,12 @@ function createSignInController(options) {
|
|
|
500
810
|
return value ? errors[value] : "";
|
|
501
811
|
};
|
|
502
812
|
const [busy, setBusy] = createSignal("");
|
|
813
|
+
const agreementAllowed = () => !options.requireAgreement || options.agreementAccepted === true;
|
|
503
814
|
const [showPassword, setShowPassword] = createSignal(false);
|
|
504
815
|
const [canPasskey, setCanPasskey] = createSignal(false);
|
|
816
|
+
const [conditionalReady, setConditionalReady] = createSignal(false);
|
|
817
|
+
let conditional;
|
|
818
|
+
let attemptedConditional = false;
|
|
505
819
|
const [code, setCode] = createSignal("");
|
|
506
820
|
const [flow, setFlow] = createSignal("");
|
|
507
821
|
const [challenge, setChallenge] = createSignal("");
|
|
@@ -520,7 +834,7 @@ function createSignInController(options) {
|
|
|
520
834
|
const attempt = new AbortController();
|
|
521
835
|
confController = attempt;
|
|
522
836
|
try {
|
|
523
|
-
const res = await fetch(
|
|
837
|
+
const res = await fetch(`${route}/config`, {
|
|
524
838
|
referrerPolicy: "origin",
|
|
525
839
|
redirect: "error",
|
|
526
840
|
signal: AbortSignal.any([attempt.signal, AbortSignal.timeout(12e3)])
|
|
@@ -532,7 +846,7 @@ function createSignInController(options) {
|
|
|
532
846
|
data.signup,
|
|
533
847
|
data.otp,
|
|
534
848
|
data.passkey
|
|
535
|
-
].some((value) => typeof value !== "boolean")) throw new Error();
|
|
849
|
+
].some((value) => typeof value !== "boolean") || [data.recovery, data.passkeyEnrollment].some((value) => value !== void 0 && typeof value !== "boolean")) throw new Error();
|
|
536
850
|
if (!attempt.signal.aborted) setConfig(data);
|
|
537
851
|
} catch {
|
|
538
852
|
if (!attempt.signal.aborted && !controller.signal.aborted) setConfigFailed(true);
|
|
@@ -544,34 +858,37 @@ function createSignInController(options) {
|
|
|
544
858
|
setStep("confirm");
|
|
545
859
|
window.history.replaceState(window.history.state, "", `${loginPath}?${new URLSearchParams({ next })}`);
|
|
546
860
|
}
|
|
547
|
-
loadConfig();
|
|
861
|
+
if (!config()) loadConfig();
|
|
862
|
+
if (options.conditionalPasskey && canPasskey()) PublicKeyCredential.isConditionalMediationAvailable?.().then((supported) => {
|
|
863
|
+
if (!controller.signal.aborted) setConditionalReady(supported);
|
|
864
|
+
}).catch(() => void 0);
|
|
548
865
|
const timer = window.setInterval(() => setNow(Date.now()), 1e3);
|
|
549
866
|
onCleanup(() => {
|
|
550
867
|
window.clearInterval(timer);
|
|
551
868
|
confController?.abort();
|
|
869
|
+
stopConditional();
|
|
552
870
|
controller.abort();
|
|
553
871
|
});
|
|
554
872
|
});
|
|
873
|
+
function stopConditional() {
|
|
874
|
+
conditional?.abort();
|
|
875
|
+
conditional = void 0;
|
|
876
|
+
}
|
|
555
877
|
function go(to) {
|
|
878
|
+
if (to !== "choose") stopConditional();
|
|
556
879
|
setErrorCode("");
|
|
557
880
|
setShowPassword(false);
|
|
558
881
|
setStep(to);
|
|
559
882
|
}
|
|
560
|
-
async function post(path, body) {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
signal: AbortSignal.any([controller.signal, AbortSignal.timeout(45e3)]),
|
|
567
|
-
body: JSON.stringify(body)
|
|
568
|
-
});
|
|
569
|
-
const data = await res.json();
|
|
570
|
-
if (!res.ok) throw new SignInError(isErrorCode(data.error) ? data.error : "unavailable");
|
|
571
|
-
return data;
|
|
883
|
+
async function post(path, body, signal = controller.signal) {
|
|
884
|
+
if (!agreementAllowed()) throw new SignInError("acceptance_required");
|
|
885
|
+
return await postAuthJSON(path, {
|
|
886
|
+
...body,
|
|
887
|
+
acceptance: options.getAcceptance?.()
|
|
888
|
+
}, AbortSignal.any([controller.signal, signal]));
|
|
572
889
|
}
|
|
573
890
|
async function request(action, fields = {}) {
|
|
574
|
-
const data = await post(
|
|
891
|
+
const data = await post(`${route}/email`, {
|
|
575
892
|
action,
|
|
576
893
|
next,
|
|
577
894
|
...fields
|
|
@@ -581,6 +898,12 @@ function createSignInController(options) {
|
|
|
581
898
|
}
|
|
582
899
|
async function run(label, op) {
|
|
583
900
|
if (busy() || controller.signal.aborted) return;
|
|
901
|
+
if (!agreementAllowed()) {
|
|
902
|
+
setErrorCode("acceptance_required");
|
|
903
|
+
return;
|
|
904
|
+
}
|
|
905
|
+
attemptedConditional = true;
|
|
906
|
+
stopConditional();
|
|
584
907
|
setBusy(label);
|
|
585
908
|
setErrorCode("");
|
|
586
909
|
try {
|
|
@@ -594,12 +917,27 @@ function createSignInController(options) {
|
|
|
594
917
|
function social(provider) {
|
|
595
918
|
if (!config()?.providers.includes(provider)) return;
|
|
596
919
|
return run(providers[provider][0], async () => {
|
|
597
|
-
const { authorize } = await post(
|
|
920
|
+
const { authorize } = await post(`${route}/start/${provider}`, { next });
|
|
598
921
|
const target = providerDestination(provider, authorize);
|
|
599
922
|
if (!target) throw new Error();
|
|
923
|
+
if (controller.signal.aborted) return;
|
|
924
|
+
if (!agreementAllowed()) throw new SignInError("acceptance_required");
|
|
925
|
+
await options.beforeOAuthNavigate?.(provider, target);
|
|
926
|
+
if (!agreementAllowed()) throw new SignInError("acceptance_required");
|
|
600
927
|
if (!controller.signal.aborted) window.location.assign(target);
|
|
601
928
|
});
|
|
602
929
|
}
|
|
930
|
+
function sendRecovery() {
|
|
931
|
+
if (!config()?.recovery || step() !== "recover") return;
|
|
932
|
+
return run("recovery", async () => {
|
|
933
|
+
if ((await post(`${route}/email`, {
|
|
934
|
+
action: "recovery_start",
|
|
935
|
+
email: email().trim(),
|
|
936
|
+
next
|
|
937
|
+
})).step !== "recovery_sent") throw new Error();
|
|
938
|
+
if (!controller.signal.aborted) go("recovery_sent");
|
|
939
|
+
});
|
|
940
|
+
}
|
|
603
941
|
function sendCode() {
|
|
604
942
|
if (!config()?.otp || step() === "otp" && wait() > 0) return;
|
|
605
943
|
return run("email", async () => {
|
|
@@ -627,41 +965,71 @@ function createSignInController(options) {
|
|
|
627
965
|
}
|
|
628
966
|
});
|
|
629
967
|
}
|
|
968
|
+
async function getPasskey(signal, autofill) {
|
|
969
|
+
const { challenge, challengeId, rpId, credentials } = await post(`${route}/email`, {
|
|
970
|
+
action: "passkey_start",
|
|
971
|
+
next
|
|
972
|
+
}, signal);
|
|
973
|
+
if (signal.aborted || !challenge || !challengeId || !rpId || !credentials) return;
|
|
974
|
+
if (!agreementAllowed()) throw new SignInError("acceptance_required");
|
|
975
|
+
if (autofill && credentials.length) return;
|
|
976
|
+
const assertion = await navigator.credentials.get({
|
|
977
|
+
signal,
|
|
978
|
+
...autofill && { mediation: "conditional" },
|
|
979
|
+
publicKey: {
|
|
980
|
+
challenge: decodeBase64Url(challenge),
|
|
981
|
+
rpId,
|
|
982
|
+
...autofill ? {} : { timeout: 6e4 },
|
|
983
|
+
userVerification: "required",
|
|
984
|
+
allowCredentials: credentials.map((id) => ({
|
|
985
|
+
id: decodeBase64Url(id),
|
|
986
|
+
type: "public-key"
|
|
987
|
+
}))
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
if (signal.aborted || !(assertion instanceof PublicKeyCredential) || !(assertion.response instanceof AuthenticatorAssertionResponse)) return;
|
|
991
|
+
const response = assertion.response;
|
|
992
|
+
return {
|
|
993
|
+
challenge_id: challengeId,
|
|
994
|
+
credential_id: encodeBase64Url(assertion.rawId),
|
|
995
|
+
client_data_json: encodeBase64Url(response.clientDataJSON),
|
|
996
|
+
authenticator_data: encodeBase64Url(response.authenticatorData),
|
|
997
|
+
signature: encodeBase64Url(response.signature),
|
|
998
|
+
user_handle: response.userHandle ? encodeBase64Url(response.userHandle) : ""
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
630
1001
|
function passkey() {
|
|
631
|
-
if (!canPasskey() || !config()?.passkey) return;
|
|
1002
|
+
if (!canPasskey() || !config()?.passkey || step() !== "choose" && !(step() === "confirm" && hasVerification)) return;
|
|
632
1003
|
return run("passkey", async () => {
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
const assertion = await navigator.credentials.get({
|
|
636
|
-
signal: controller.signal,
|
|
637
|
-
publicKey: {
|
|
638
|
-
challenge: decode(challenge),
|
|
639
|
-
rpId,
|
|
640
|
-
timeout: 6e4,
|
|
641
|
-
userVerification: "required",
|
|
642
|
-
allowCredentials: credentials.map((id) => ({
|
|
643
|
-
id: decode(id),
|
|
644
|
-
type: "public-key"
|
|
645
|
-
}))
|
|
646
|
-
}
|
|
647
|
-
}).catch((error) => {
|
|
648
|
-
if (error instanceof DOMException && error.name === "NotAllowedError") return null;
|
|
1004
|
+
const fields = await getPasskey(controller.signal, false).catch((error) => {
|
|
1005
|
+
if (error instanceof DOMException && error.name === "NotAllowedError") return;
|
|
649
1006
|
throw error;
|
|
650
1007
|
});
|
|
651
|
-
if (!
|
|
652
|
-
|
|
653
|
-
await request("passkey_verify", {
|
|
654
|
-
challenge_id: challengeId,
|
|
655
|
-
credential_id: encode(assertion.rawId),
|
|
656
|
-
client_data_json: encode(response.clientDataJSON),
|
|
657
|
-
authenticator_data: encode(response.authenticatorData),
|
|
658
|
-
signature: encode(response.signature),
|
|
659
|
-
user_handle: response.userHandle ? encode(response.userHandle) : ""
|
|
660
|
-
});
|
|
1008
|
+
if (!fields) throw new SignInError("method_unavailable");
|
|
1009
|
+
await request("passkey_verify", fields);
|
|
661
1010
|
});
|
|
662
1011
|
}
|
|
663
|
-
|
|
664
|
-
if (
|
|
1012
|
+
createEffect(() => {
|
|
1013
|
+
if (!agreementAllowed()) {
|
|
1014
|
+
stopConditional();
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
if (attemptedConditional || !conditionalReady() || step() !== "choose" || !config()?.passkey) return;
|
|
1018
|
+
if (options.getAcceptance && !options.getAcceptance()) return;
|
|
1019
|
+
attemptedConditional = true;
|
|
1020
|
+
const attempt = new AbortController();
|
|
1021
|
+
conditional = attempt;
|
|
1022
|
+
getPasskey(attempt.signal, true).then((fields) => {
|
|
1023
|
+
if (fields && !attempt.signal.aborted && !controller.signal.aborted) return run("passkey", async () => {
|
|
1024
|
+
await request("passkey_verify", fields);
|
|
1025
|
+
});
|
|
1026
|
+
}).catch(() => void 0).finally(() => {
|
|
1027
|
+
if (conditional === attempt) conditional = void 0;
|
|
1028
|
+
});
|
|
1029
|
+
});
|
|
1030
|
+
function continueWithEmail(method) {
|
|
1031
|
+
if (method !== "password" && config()?.otp) return sendCode();
|
|
1032
|
+
if (method === "otp") return void 0;
|
|
665
1033
|
if (config()?.password && !busy()) go("password");
|
|
666
1034
|
}
|
|
667
1035
|
function submitPassword(password) {
|
|
@@ -709,6 +1077,7 @@ function createSignInController(options) {
|
|
|
709
1077
|
});
|
|
710
1078
|
}
|
|
711
1079
|
return {
|
|
1080
|
+
emailRoute: `${route}/email`,
|
|
712
1081
|
config,
|
|
713
1082
|
configFailed,
|
|
714
1083
|
loadConfig,
|
|
@@ -718,6 +1087,7 @@ function createSignInController(options) {
|
|
|
718
1087
|
setEmail,
|
|
719
1088
|
error,
|
|
720
1089
|
errorCode,
|
|
1090
|
+
agreementAllowed,
|
|
721
1091
|
busy,
|
|
722
1092
|
showPassword,
|
|
723
1093
|
setShowPassword,
|
|
@@ -730,6 +1100,7 @@ function createSignInController(options) {
|
|
|
730
1100
|
continueWithEmail,
|
|
731
1101
|
social,
|
|
732
1102
|
sendCode,
|
|
1103
|
+
sendRecovery,
|
|
733
1104
|
verifyCode,
|
|
734
1105
|
passkey,
|
|
735
1106
|
submitPassword,
|
|
@@ -738,29 +1109,43 @@ function createSignInController(options) {
|
|
|
738
1109
|
}
|
|
739
1110
|
// src/sign-in.tsx
|
|
740
1111
|
var _tmpl$ = [
|
|
1112
|
+
"<span",
|
|
1113
|
+
">",
|
|
1114
|
+
"</span>"
|
|
1115
|
+
];
|
|
1116
|
+
var _tmpl$2 = [
|
|
1117
|
+
"<button",
|
|
1118
|
+
" type=\"button\"",
|
|
1119
|
+
"",
|
|
1120
|
+
"><!--$-->",
|
|
1121
|
+
"<!--/--><!--$-->",
|
|
1122
|
+
"<!--/--></button>"
|
|
1123
|
+
];
|
|
1124
|
+
var _tmpl$3 = [
|
|
741
1125
|
"<p",
|
|
742
1126
|
">",
|
|
743
1127
|
"</p>"
|
|
744
1128
|
];
|
|
745
|
-
var _tmpl$
|
|
1129
|
+
var _tmpl$4 = [
|
|
746
1130
|
"<p",
|
|
747
1131
|
" role=\"alert\"",
|
|
748
1132
|
">",
|
|
749
1133
|
"</p>"
|
|
750
1134
|
];
|
|
751
|
-
var _tmpl$
|
|
1135
|
+
var _tmpl$5 = [
|
|
752
1136
|
"<label",
|
|
753
1137
|
">",
|
|
754
1138
|
"</label>"
|
|
755
1139
|
];
|
|
756
|
-
var _tmpl$
|
|
1140
|
+
var _tmpl$6 = [
|
|
757
1141
|
"<input",
|
|
758
|
-
" type=\"email\" name=\"username\"
|
|
1142
|
+
" type=\"email\" name=\"username\"",
|
|
1143
|
+
" required maxlength=\"254\"",
|
|
759
1144
|
">"
|
|
760
1145
|
];
|
|
761
|
-
var _tmpl$
|
|
1146
|
+
var _tmpl$7 = [
|
|
762
1147
|
"<form",
|
|
763
|
-
" method=\"post\"
|
|
1148
|
+
" method=\"post\"",
|
|
764
1149
|
"><!--$-->",
|
|
765
1150
|
"<!--/--><label",
|
|
766
1151
|
">",
|
|
@@ -776,22 +1161,34 @@ var _tmpl$5 = [
|
|
|
776
1161
|
">",
|
|
777
1162
|
"</button></form>"
|
|
778
1163
|
];
|
|
779
|
-
var _tmpl$
|
|
1164
|
+
var _tmpl$8 = [
|
|
780
1165
|
"<button",
|
|
781
1166
|
" type=\"button\"",
|
|
782
1167
|
"",
|
|
783
1168
|
">",
|
|
784
1169
|
"</button>"
|
|
785
1170
|
];
|
|
786
|
-
var _tmpl$
|
|
1171
|
+
var _tmpl$9 = [
|
|
1172
|
+
"<form",
|
|
1173
|
+
" method=\"post\"",
|
|
1174
|
+
"><label",
|
|
1175
|
+
">",
|
|
1176
|
+
"</label><input",
|
|
1177
|
+
" type=\"email\" autocomplete=\"email\" required maxlength=\"254\"",
|
|
1178
|
+
"><button type=\"submit\"",
|
|
1179
|
+
"",
|
|
1180
|
+
">",
|
|
1181
|
+
"</button></form>"
|
|
1182
|
+
];
|
|
1183
|
+
var _tmpl$0 = [
|
|
787
1184
|
"<button",
|
|
788
1185
|
" type=\"button\"",
|
|
789
1186
|
">",
|
|
790
1187
|
"</button>"
|
|
791
1188
|
];
|
|
792
|
-
var _tmpl$
|
|
1189
|
+
var _tmpl$1 = [
|
|
793
1190
|
"<form",
|
|
794
|
-
" method=\"post\"
|
|
1191
|
+
" method=\"post\"",
|
|
795
1192
|
"><label",
|
|
796
1193
|
">",
|
|
797
1194
|
"</label><div",
|
|
@@ -805,7 +1202,7 @@ var _tmpl$8 = [
|
|
|
805
1202
|
">",
|
|
806
1203
|
"</button></form>"
|
|
807
1204
|
];
|
|
808
|
-
var _tmpl$
|
|
1205
|
+
var _tmpl$10 = [
|
|
809
1206
|
"<div",
|
|
810
1207
|
"><button type=\"button\"",
|
|
811
1208
|
"",
|
|
@@ -816,9 +1213,9 @@ var _tmpl$9 = [
|
|
|
816
1213
|
"</button><!--$-->",
|
|
817
1214
|
"<!--/--></div>"
|
|
818
1215
|
];
|
|
819
|
-
var _tmpl$
|
|
1216
|
+
var _tmpl$11 = [
|
|
820
1217
|
"<form",
|
|
821
|
-
" method=\"post\"
|
|
1218
|
+
" method=\"post\"",
|
|
822
1219
|
"><label",
|
|
823
1220
|
">",
|
|
824
1221
|
"</label><input",
|
|
@@ -829,7 +1226,7 @@ var _tmpl$0 = [
|
|
|
829
1226
|
">",
|
|
830
1227
|
"</button></form>"
|
|
831
1228
|
];
|
|
832
|
-
var _tmpl$
|
|
1229
|
+
var _tmpl$12 = [
|
|
833
1230
|
"<div",
|
|
834
1231
|
"><button type=\"button\"",
|
|
835
1232
|
">",
|
|
@@ -837,7 +1234,7 @@ var _tmpl$1 = [
|
|
|
837
1234
|
">",
|
|
838
1235
|
"</button></div>"
|
|
839
1236
|
];
|
|
840
|
-
var _tmpl$
|
|
1237
|
+
var _tmpl$13 = [
|
|
841
1238
|
"<div",
|
|
842
1239
|
"><label",
|
|
843
1240
|
">",
|
|
@@ -845,7 +1242,12 @@ var _tmpl$10 = [
|
|
|
845
1242
|
">",
|
|
846
1243
|
"</select></div>"
|
|
847
1244
|
];
|
|
848
|
-
var _tmpl$
|
|
1245
|
+
var _tmpl$14 = [
|
|
1246
|
+
"<div",
|
|
1247
|
+
">",
|
|
1248
|
+
"</div>"
|
|
1249
|
+
];
|
|
1250
|
+
var _tmpl$15 = [
|
|
849
1251
|
"<section",
|
|
850
1252
|
" style=\"",
|
|
851
1253
|
"\"",
|
|
@@ -861,29 +1263,26 @@ var _tmpl$11 = [
|
|
|
861
1263
|
"<!--/--><!--$-->",
|
|
862
1264
|
"<!--/--></div></section>"
|
|
863
1265
|
];
|
|
864
|
-
var _tmpl$
|
|
1266
|
+
var _tmpl$16 = [
|
|
865
1267
|
"<output",
|
|
866
1268
|
">",
|
|
867
1269
|
"</output>"
|
|
868
1270
|
];
|
|
869
|
-
var _tmpl$
|
|
870
|
-
"<div",
|
|
871
|
-
">",
|
|
872
|
-
"</div>"
|
|
873
|
-
];
|
|
874
|
-
var _tmpl$14 = [
|
|
1271
|
+
var _tmpl$17 = [
|
|
875
1272
|
"<form",
|
|
876
|
-
" method=\"post\"
|
|
1273
|
+
" method=\"post\"",
|
|
877
1274
|
"><label",
|
|
878
1275
|
">",
|
|
879
1276
|
"</label><input",
|
|
880
|
-
" type=\"email\" name=\"email\"
|
|
1277
|
+
" type=\"email\" name=\"email\"",
|
|
1278
|
+
" required maxlength=\"254\"",
|
|
881
1279
|
"><button type=\"submit\"",
|
|
882
1280
|
"",
|
|
883
|
-
"
|
|
884
|
-
"
|
|
1281
|
+
"><!--$-->",
|
|
1282
|
+
"<!--/--><!--$-->",
|
|
1283
|
+
"<!--/--></button></form>"
|
|
885
1284
|
];
|
|
886
|
-
var _tmpl$
|
|
1285
|
+
var _tmpl$18 = [
|
|
887
1286
|
"<p",
|
|
888
1287
|
"><!--$-->",
|
|
889
1288
|
"<!--/--> <button type=\"button\"",
|
|
@@ -891,25 +1290,21 @@ var _tmpl$15 = [
|
|
|
891
1290
|
">",
|
|
892
1291
|
"</button></p>"
|
|
893
1292
|
];
|
|
894
|
-
var _tmpl$
|
|
1293
|
+
var _tmpl$19 = [
|
|
895
1294
|
"<button",
|
|
896
1295
|
" type=\"button\"",
|
|
897
1296
|
"",
|
|
898
1297
|
"><!--$-->",
|
|
899
1298
|
"<!--/--><!--$-->",
|
|
1299
|
+
"<!--/--><!--$-->",
|
|
900
1300
|
"<!--/--></button>"
|
|
901
1301
|
];
|
|
902
|
-
var _tmpl$
|
|
1302
|
+
var _tmpl$20 = [
|
|
903
1303
|
"<input",
|
|
904
1304
|
" tabindex=\"-1\" hidden name=\"username\"",
|
|
905
|
-
"
|
|
906
|
-
];
|
|
907
|
-
var _tmpl$18 = [
|
|
908
|
-
"<span",
|
|
909
|
-
">",
|
|
910
|
-
"</span>"
|
|
1305
|
+
" readonly>"
|
|
911
1306
|
];
|
|
912
|
-
var _tmpl$
|
|
1307
|
+
var _tmpl$21 = [
|
|
913
1308
|
"<option",
|
|
914
1309
|
"",
|
|
915
1310
|
">",
|
|
@@ -924,12 +1319,14 @@ var icons = {
|
|
|
924
1319
|
microsoft: MicrosoftIcon
|
|
925
1320
|
};
|
|
926
1321
|
function SylphxSignIn(props) {
|
|
927
|
-
const { config, configFailed, loadConfig, step, email, setEmail, errorCode, busy, showPassword, setShowPassword, canPasskey, code, setCode, recovery, setRecovery, wait, continueWithEmail, social, sendCode, verifyCode, passkey, submitPassword, submitMfa } = createSignInController(props);
|
|
1322
|
+
const { emailRoute, config, configFailed, loadConfig, step, email, setEmail, errorCode, busy, agreementAllowed, showPassword, setShowPassword, canPasskey, code, setCode, recovery, setRecovery, wait, continueWithEmail, social, sendCode, sendRecovery, verifyCode, passkey, submitPassword, submitMfa } = createSignInController(props);
|
|
928
1323
|
const [detected, setDetected] = createSignal();
|
|
929
1324
|
const [selected, setSelected] = createSignal();
|
|
930
1325
|
const locale = createMemo(() => props.locale === void 0 ? selected() ?? detected() ?? resolveAuthLocale(props.localePreferences ?? []) : resolveAuthLocale([props.locale, ...props.localePreferences ?? []]));
|
|
931
|
-
const text = () =>
|
|
932
|
-
const
|
|
1326
|
+
const text = createMemo(() => resolveSignInMessages(locale(), props.messages));
|
|
1327
|
+
const language = () => signInLanguage(locale(), props.locale, props.messages);
|
|
1328
|
+
const seconds = createMemo(() => authSecondsFormat(language()));
|
|
1329
|
+
const disabled = () => !!busy() || !agreementAllowed();
|
|
933
1330
|
const error = () => {
|
|
934
1331
|
const code = errorCode();
|
|
935
1332
|
return code ? text().errors[code] : "";
|
|
@@ -944,12 +1341,29 @@ function SylphxSignIn(props) {
|
|
|
944
1341
|
if (props.appearance?.unstyled) return custom;
|
|
945
1342
|
return custom ? `auth-sign-in-${part} ${custom}` : `auth-sign-in-${part}`;
|
|
946
1343
|
}
|
|
947
|
-
|
|
1344
|
+
const [showPasswordEmail, setShowPasswordEmail] = createSignal(false);
|
|
1345
|
+
const lastUsed = (method) => createComponent(Show, {
|
|
1346
|
+
get when() {
|
|
1347
|
+
return props.lastUsed === method;
|
|
1348
|
+
},
|
|
1349
|
+
get children() {
|
|
1350
|
+
return ssr(_tmpl$, ssrHydrationKey() + ssrAttribute("class", escape(className("last-used"), true), false), escape(text().lastUsed));
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
const passkeyAction = () => createComponent(Show, {
|
|
1354
|
+
get when() {
|
|
1355
|
+
return memo(() => !!config()?.passkey)() && canPasskey();
|
|
1356
|
+
},
|
|
1357
|
+
get children() {
|
|
1358
|
+
return ssr(_tmpl$2, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", disabled(), true), busy() === "passkey" ? escape(text().waitingPasskey) : escape(text().usePasskey), escape(lastUsed("passkey")));
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
return ssr(_tmpl$15, ssrHydrationKey() + ssrAttribute("class", escape(className("panel"), true), false), ssrStyle(props.appearance?.tokens), ssrAttribute("aria-labelledby", escape(id("title"), true), false) + ssrAttribute("lang", escape(language(), true), false), ssrAttribute("class", escape(className("content"), true), false), escape(createComponent(Show, {
|
|
948
1362
|
get when() {
|
|
949
1363
|
return props.kicker;
|
|
950
1364
|
},
|
|
951
1365
|
get children() {
|
|
952
|
-
return ssr(_tmpl
|
|
1366
|
+
return ssr(_tmpl$3, ssrHydrationKey() + ssrAttribute("class", escape(className("kicker"), true), false), escape(props.kicker));
|
|
953
1367
|
}
|
|
954
1368
|
})), ssrAttribute("id", escape(id("title"), true), false) + ssrAttribute("class", escape(className("title"), true), false), escape({
|
|
955
1369
|
choose: props.title ?? text().signIn,
|
|
@@ -958,7 +1372,9 @@ function SylphxSignIn(props) {
|
|
|
958
1372
|
check_email: text().checkInbox,
|
|
959
1373
|
confirm: text().confirmEmail,
|
|
960
1374
|
otp: text().checkInbox,
|
|
961
|
-
mfa: text().verifyIdentity
|
|
1375
|
+
mfa: text().verifyIdentity,
|
|
1376
|
+
recover: text().recoverAccount,
|
|
1377
|
+
recovery_sent: text().recoverySent
|
|
962
1378
|
}[step()]), ssrAttribute("class", escape(className("sub"), true), false), escape({
|
|
963
1379
|
choose: props.description ?? text().chooseMethod,
|
|
964
1380
|
password: email(),
|
|
@@ -966,13 +1382,15 @@ function SylphxSignIn(props) {
|
|
|
966
1382
|
check_email: text().checkEmailDescription,
|
|
967
1383
|
confirm: text().confirmEmailDescription,
|
|
968
1384
|
otp: text().enterEmailCode(email()),
|
|
969
|
-
mfa: recovery() ? text().enterRecovery : text().enterAuthenticator
|
|
1385
|
+
mfa: recovery() ? text().enterRecovery : text().enterAuthenticator,
|
|
1386
|
+
recover: text().recoverDescription,
|
|
1387
|
+
recovery_sent: text().recoverySentDescription
|
|
970
1388
|
}[step()]), escape(createComponent(Show, {
|
|
971
1389
|
get when() {
|
|
972
1390
|
return error();
|
|
973
1391
|
},
|
|
974
1392
|
get children() {
|
|
975
|
-
return ssr(_tmpl$
|
|
1393
|
+
return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("class", escape(className("error"), true), false), escape(error()));
|
|
976
1394
|
}
|
|
977
1395
|
})), escape(createComponent(Switch, { get children() {
|
|
978
1396
|
return [
|
|
@@ -991,21 +1409,21 @@ function SylphxSignIn(props) {
|
|
|
991
1409
|
return configFailed();
|
|
992
1410
|
},
|
|
993
1411
|
get fallback() {
|
|
994
|
-
return ssr(_tmpl$
|
|
1412
|
+
return ssr(_tmpl$16, ssrHydrationKey() + ssrAttribute("class", escape(className("loading"), true), false), escape(text().loading));
|
|
995
1413
|
},
|
|
996
1414
|
get children() {
|
|
997
|
-
return [ssr(_tmpl$
|
|
1415
|
+
return [ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("class", escape(className("error"), true), false), escape(text().errors.unavailable)), ssr(_tmpl$0, ssrHydrationKey(), ssrAttribute("class", escape(className("secondary"), true), false), escape(text().retry))];
|
|
998
1416
|
}
|
|
999
1417
|
});
|
|
1000
1418
|
},
|
|
1001
1419
|
children: (methods) => [
|
|
1002
|
-
ssr(_tmpl$
|
|
1420
|
+
ssr(_tmpl$14, ssrHydrationKey() + ssrAttribute("class", escape(className("providers"), true), false), escape(createComponent(For, {
|
|
1003
1421
|
get each() {
|
|
1004
1422
|
return methods().providers;
|
|
1005
1423
|
},
|
|
1006
1424
|
children: (provider) => {
|
|
1007
1425
|
const Icon = icons[provider];
|
|
1008
|
-
return ssr(_tmpl$
|
|
1426
|
+
return ssr(_tmpl$19, ssrHydrationKey(), ssrAttribute("class", escape(className("secondary"), true), false), ssrAttribute("disabled", disabled(), true), Icon && escape(createComponent(Icon, {})), busy() === providers[provider][0] ? escape(text().openingProvider(providers[provider][0])) : escape(text().continueProvider(providers[provider][0])), escape(lastUsed(provider)));
|
|
1009
1427
|
}
|
|
1010
1428
|
}))),
|
|
1011
1429
|
createComponent(Show, {
|
|
@@ -1018,25 +1436,26 @@ function SylphxSignIn(props) {
|
|
|
1018
1436
|
return methods().providers.length;
|
|
1019
1437
|
},
|
|
1020
1438
|
get children() {
|
|
1021
|
-
return ssr(_tmpl$
|
|
1439
|
+
return ssr(_tmpl$14, ssrHydrationKey() + ssrAttribute("class", escape(className("divider"), true), false), escape(text().orEmail));
|
|
1022
1440
|
}
|
|
1023
|
-
}), ssr(_tmpl$
|
|
1441
|
+
}), ssr(_tmpl$17, ssrHydrationKey(), ssrAttribute("action", escape(emailRoute, true), false) + ssrAttribute("class", escape(className("form"), true), false), ssrAttribute("for", escape(id("email"), true), false), escape(text().email), ssrAttribute("id", escape(id("email"), true), false), ssrAttribute("autocomplete", config()?.passkey ? "username webauthn" : "username", false), ssrAttribute("value", escape(email(), true), false), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled", disabled(), true), busy() === "email" ? escape(text().sendingCode) : methods().otp ? escape(text().emailCodeAction) : escape(text().continueEmail), escape(lastUsed(methods().otp ? "otp" : "password")))];
|
|
1024
1442
|
}
|
|
1025
1443
|
}),
|
|
1026
1444
|
createComponent(Show, {
|
|
1027
1445
|
get when() {
|
|
1028
|
-
return memo(() => !!methods().
|
|
1446
|
+
return memo(() => !!methods().otp)() && methods().password;
|
|
1029
1447
|
},
|
|
1030
1448
|
get children() {
|
|
1031
|
-
return ssr(_tmpl$
|
|
1449
|
+
return ssr(_tmpl$2, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().usePassword), escape(lastUsed("password")));
|
|
1032
1450
|
}
|
|
1033
1451
|
}),
|
|
1452
|
+
passkeyAction(),
|
|
1034
1453
|
createComponent(Show, {
|
|
1035
1454
|
get when() {
|
|
1036
1455
|
return methods().signup;
|
|
1037
1456
|
},
|
|
1038
1457
|
get children() {
|
|
1039
|
-
return ssr(_tmpl$
|
|
1458
|
+
return ssr(_tmpl$18, ssrHydrationKey() + ssrAttribute("class", escape(className("switch"), true), false), escape(text().newHere), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().createAnAccount));
|
|
1040
1459
|
}
|
|
1041
1460
|
}),
|
|
1042
1461
|
createComponent(Show, {
|
|
@@ -1044,7 +1463,7 @@ function SylphxSignIn(props) {
|
|
|
1044
1463
|
return memo(() => !!(!methods().password && !methods().signup && !methods().otp && !methods().providers.length))() && !(methods().passkey && canPasskey());
|
|
1045
1464
|
},
|
|
1046
1465
|
get children() {
|
|
1047
|
-
return ssr(_tmpl$
|
|
1466
|
+
return ssr(_tmpl$16, ssrHydrationKey(), escape(text().noMethods));
|
|
1048
1467
|
}
|
|
1049
1468
|
})
|
|
1050
1469
|
]
|
|
@@ -1056,24 +1475,59 @@ function SylphxSignIn(props) {
|
|
|
1056
1475
|
return step() === "password" || step() === "signup" || step() === "confirm";
|
|
1057
1476
|
},
|
|
1058
1477
|
get children() {
|
|
1059
|
-
return [
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1478
|
+
return [
|
|
1479
|
+
ssr(_tmpl$7, ssrHydrationKey(), ssrAttribute("action", escape(emailRoute, true), false) + ssrAttribute("class", escape(className("form"), true), false), escape(createComponent(Show, {
|
|
1480
|
+
get when() {
|
|
1481
|
+
return step() !== "password" || showPasswordEmail();
|
|
1482
|
+
},
|
|
1483
|
+
get fallback() {
|
|
1484
|
+
return ssr(_tmpl$20, ssrHydrationKey(), ssrAttribute("value", escape(email(), true), false) + ssrAttribute("autocomplete", config()?.passkey ? "username webauthn" : "username", false));
|
|
1485
|
+
},
|
|
1486
|
+
get children() {
|
|
1487
|
+
return [ssr(_tmpl$5, ssrHydrationKey() + ssrAttribute("for", escape(id("account-email"), true), false), escape(text().email)), ssr(_tmpl$6, ssrHydrationKey() + ssrAttribute("id", escape(id("account-email"), true), false), ssrAttribute("autocomplete", config()?.passkey ? "username webauthn" : "username", false), ssrAttribute("value", escape(email(), true), false))];
|
|
1488
|
+
}
|
|
1489
|
+
})), ssrAttribute("for", escape(id("password"), true), false), escape(text().password), ssrAttribute("class", escape(className("password"), true), false), ssrAttribute("id", escape(id("password"), true), false) + ssrAttribute("type", showPassword() ? "text" : "password", false) + ssrAttribute("autocomplete", step() === "signup" ? "new-password" : "current-password", false), ssrAttribute("minlength", step() === "signup" ? 12 : escape(void 0, true), false), ssrAttribute("aria-describedby", step() === "signup" ? escape(id("password-hint"), true) : escape(void 0, true), false), ssrAttribute("class", escape(className("link"), true), false) + ssrAttribute("aria-label", showPassword() ? escape(text().hidePassword, true) : escape(text().showPassword, true), false), showPassword() ? escape(text().hide) : escape(text().show), escape(createComponent(Show, {
|
|
1490
|
+
get when() {
|
|
1491
|
+
return step() === "signup";
|
|
1492
|
+
},
|
|
1493
|
+
get children() {
|
|
1494
|
+
return ssr(_tmpl$3, ssrHydrationKey() + ssrAttribute("class", escape(className("hint"), true), false) + ssrAttribute("id", escape(id("password-hint"), true), false), escape(text().minimumPassword));
|
|
1495
|
+
}
|
|
1496
|
+
})), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled", disabled(), true), busy() ? escape(text().working) : step() === "signup" ? escape(text().createAccount) : step() === "confirm" ? escape(text().confirmAndSignIn) : escape(text().signIn)),
|
|
1497
|
+
createComponent(Show, {
|
|
1498
|
+
get when() {
|
|
1499
|
+
return memo(() => step() === "password")() && config()?.recovery;
|
|
1500
|
+
},
|
|
1501
|
+
get children() {
|
|
1502
|
+
return ssr(_tmpl$8, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().forgotPassword));
|
|
1503
|
+
}
|
|
1504
|
+
}),
|
|
1505
|
+
createComponent(Show, {
|
|
1506
|
+
get when() {
|
|
1507
|
+
return step() === "confirm";
|
|
1508
|
+
},
|
|
1509
|
+
get children() {
|
|
1510
|
+
return passkeyAction();
|
|
1511
|
+
}
|
|
1512
|
+
}),
|
|
1513
|
+
ssr(_tmpl$8, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), step() === "password" ? escape(text().changeEmailOrMethod) : escape(text().backToSignIn))
|
|
1514
|
+
];
|
|
1515
|
+
}
|
|
1516
|
+
}),
|
|
1517
|
+
createComponent(Match, {
|
|
1518
|
+
get when() {
|
|
1519
|
+
return step() === "recover";
|
|
1520
|
+
},
|
|
1521
|
+
get children() {
|
|
1522
|
+
return [ssr(_tmpl$9, ssrHydrationKey(), ssrAttribute("action", escape(emailRoute, true), false) + ssrAttribute("class", escape(className("form"), true), false), ssrAttribute("for", escape(id("recovery-email"), true), false), escape(text().email), ssrAttribute("id", escape(id("recovery-email"), true), false), ssrAttribute("value", escape(email(), true), false), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled", disabled(), true), busy() ? escape(text().working) : escape(text().sendResetLink)), ssr(_tmpl$8, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().backToSignIn))];
|
|
1523
|
+
}
|
|
1524
|
+
}),
|
|
1525
|
+
createComponent(Match, {
|
|
1526
|
+
get when() {
|
|
1527
|
+
return step() === "recovery_sent";
|
|
1528
|
+
},
|
|
1529
|
+
get children() {
|
|
1530
|
+
return ssr(_tmpl$0, ssrHydrationKey(), ssrAttribute("class", escape(className("secondary"), true), false), escape(text().backToSignIn));
|
|
1077
1531
|
}
|
|
1078
1532
|
}),
|
|
1079
1533
|
createComponent(Match, {
|
|
@@ -1081,7 +1535,7 @@ function SylphxSignIn(props) {
|
|
|
1081
1535
|
return step() === "check_email";
|
|
1082
1536
|
},
|
|
1083
1537
|
get children() {
|
|
1084
|
-
return ssr(_tmpl$
|
|
1538
|
+
return ssr(_tmpl$0, ssrHydrationKey(), ssrAttribute("class", escape(className("secondary"), true), false), escape(text().backToSignIn));
|
|
1085
1539
|
}
|
|
1086
1540
|
}),
|
|
1087
1541
|
createComponent(Match, {
|
|
@@ -1089,7 +1543,7 @@ function SylphxSignIn(props) {
|
|
|
1089
1543
|
return step() === "otp";
|
|
1090
1544
|
},
|
|
1091
1545
|
get children() {
|
|
1092
|
-
return [ssr(_tmpl$
|
|
1546
|
+
return [ssr(_tmpl$1, ssrHydrationKey(), ssrAttribute("action", escape(emailRoute, true), false) + ssrAttribute("class", escape(className("form"), true), false), ssrAttribute("for", escape(id("code"), true), false), escape(text().emailCode), ssrAttribute("class", escape(className("otp"), true), false), ssrAttribute("id", escape(id("code"), true), false), ssrAttribute("value", escape(code(), true), false), ssrAttribute("readonly", !!busy(), true), ssrAttribute("class", escape(className("cells"), true), false), escape(createComponent(For, {
|
|
1093
1547
|
each: [
|
|
1094
1548
|
0,
|
|
1095
1549
|
1,
|
|
@@ -1098,13 +1552,13 @@ function SylphxSignIn(props) {
|
|
|
1098
1552
|
4,
|
|
1099
1553
|
5
|
|
1100
1554
|
],
|
|
1101
|
-
children: (i) => ssr(_tmpl
|
|
1102
|
-
})), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled",
|
|
1555
|
+
children: (i) => ssr(_tmpl$, ssrHydrationKey(), escape(code()[i] ?? ""))
|
|
1556
|
+
})), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled", disabled() || code().length !== 6, true), busy() === "verify" ? escape(text().checkingCode) : escape(text().verifyCode)), ssr(_tmpl$10, ssrHydrationKey() + ssrAttribute("class", escape(className("actions"), true), false), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", disabled() || wait() > 0, true), wait() ? escape(text().resendIn(seconds().format(wait()))) : escape(text().resendCode), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().changeEmail), escape(createComponent(Show, {
|
|
1103
1557
|
get when() {
|
|
1104
1558
|
return config()?.password;
|
|
1105
1559
|
},
|
|
1106
1560
|
get children() {
|
|
1107
|
-
return ssr(_tmpl$
|
|
1561
|
+
return ssr(_tmpl$8, ssrHydrationKey(), ssrAttribute("class", escape(className("link"), true), false), ssrAttribute("disabled", !!busy(), true), escape(text().usePassword));
|
|
1108
1562
|
}
|
|
1109
1563
|
})))];
|
|
1110
1564
|
}
|
|
@@ -1114,7 +1568,7 @@ function SylphxSignIn(props) {
|
|
|
1114
1568
|
return step() === "mfa";
|
|
1115
1569
|
},
|
|
1116
1570
|
get children() {
|
|
1117
|
-
return [ssr(_tmpl$
|
|
1571
|
+
return [ssr(_tmpl$11, ssrHydrationKey(), ssrAttribute("action", escape(emailRoute, true), false) + ssrAttribute("class", escape(className("form"), true), false), ssrAttribute("for", escape(id("mfa"), true), false), recovery() ? escape(text().recoveryCode) : escape(text().authenticatorCode), ssrAttribute("id", escape(id("mfa"), true), false), ssrAttribute("inputmode", recovery() ? "text" : "numeric", false), ssrAttribute("maxlength", recovery() ? 128 : 6, false), ssrAttribute("class", escape(className("primary"), true), false), ssrAttribute("disabled", disabled(), true), busy() ? escape(text().checkingCode) : escape(text().verifyAndSignIn)), ssr(_tmpl$12, ssrHydrationKey() + ssrAttribute("class", escape(className("actions"), true), false), ssrAttribute("disabled", !!busy(), true) + ssrAttribute("class", escape(className("link"), true), false), recovery() ? escape(text().useAuthenticator) : escape(text().useRecovery), ssrAttribute("disabled", !!busy(), true) + ssrAttribute("class", escape(className("link"), true), false), escape(text().backToSignIn))];
|
|
1118
1572
|
}
|
|
1119
1573
|
})
|
|
1120
1574
|
];
|
|
@@ -1123,9 +1577,9 @@ function SylphxSignIn(props) {
|
|
|
1123
1577
|
return memo(() => props.showLocaleSelector !== false)() && (props.locale === void 0 || props.onLocaleChange);
|
|
1124
1578
|
},
|
|
1125
1579
|
get children() {
|
|
1126
|
-
return ssr(_tmpl$
|
|
1580
|
+
return ssr(_tmpl$13, ssrHydrationKey() + ssrAttribute("class", escape(className("locale"), true), false), ssrAttribute("for", escape(id("locale"), true), false), escape(text().language), ssrAttribute("id", escape(id("locale"), true), false) + ssrAttribute("value", escape(locale(), true), false), escape(createComponent(For, {
|
|
1127
1581
|
each: locales,
|
|
1128
|
-
children: (item) => ssr(_tmpl$
|
|
1582
|
+
children: (item) => ssr(_tmpl$21, ssrHydrationKey() + ssrAttribute("value", escape(item, true), false) + ssrAttribute("lang", escape(item, true), false), ssrAttribute("selected", locale() === item, true), escape(localeNames[item]))
|
|
1129
1583
|
})));
|
|
1130
1584
|
}
|
|
1131
1585
|
})), escape(createComponent(Show, {
|
|
@@ -1133,8 +1587,8 @@ function SylphxSignIn(props) {
|
|
|
1133
1587
|
return props.agreement;
|
|
1134
1588
|
},
|
|
1135
1589
|
get children() {
|
|
1136
|
-
return ssr(_tmpl
|
|
1590
|
+
return ssr(_tmpl$14, ssrHydrationKey() + ssrAttribute("class", escape(className("agreement"), true), false), escape(props.agreement));
|
|
1137
1591
|
}
|
|
1138
1592
|
})));
|
|
1139
1593
|
}
|
|
1140
|
-
export { SylphxSignIn, createSignInController, localeNames, resolveAuthLocale, catalogs as signInMessages };
|
|
1594
|
+
export { SylphxPasskeyEnroll, SylphxSignIn, createSignInController, localeNames, resolveAuthLocale, resolveSignInMessages, catalogs as signInMessages };
|