@open-mercato/core 0.11.1-develop.8545.1.dd603570fd → 0.11.1-develop.8549.1.bd34c91190
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/.turbo/turbo-build.log +1 -1
- package/dist/modules/customer_accounts/api/admin/users/[id]/verify-email.js +10 -30
- package/dist/modules/customer_accounts/api/admin/users/[id]/verify-email.js.map +2 -2
- package/dist/modules/customer_accounts/api/email/verify.js +11 -10
- package/dist/modules/customer_accounts/api/email/verify.js.map +2 -2
- package/dist/modules/customer_accounts/api/magic-link/verify.js +9 -8
- package/dist/modules/customer_accounts/api/magic-link/verify.js.map +2 -2
- package/dist/modules/customer_accounts/api/password/reset-confirm.js +13 -16
- package/dist/modules/customer_accounts/api/password/reset-confirm.js.map +2 -2
- package/dist/modules/customer_accounts/api/signup.js +33 -19
- package/dist/modules/customer_accounts/api/signup.js.map +3 -3
- package/dist/modules/customer_accounts/data/validators.js +3 -2
- package/dist/modules/customer_accounts/data/validators.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuth.js +11 -10
- package/dist/modules/customer_accounts/lib/customerAuth.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerAuthServer.js +7 -7
- package/dist/modules/customer_accounts/lib/customerAuthServer.js.map +2 -2
- package/dist/modules/customer_accounts/lib/pendingSignup.js +16 -0
- package/dist/modules/customer_accounts/lib/pendingSignup.js.map +7 -0
- package/dist/modules/customer_accounts/lib/verifyCustomerEmail.js +50 -0
- package/dist/modules/customer_accounts/lib/verifyCustomerEmail.js.map +7 -0
- package/dist/modules/customer_accounts/services/customerInvitationService.js +15 -1
- package/dist/modules/customer_accounts/services/customerInvitationService.js.map +2 -2
- package/dist/modules/customer_accounts/services/customerTokenService.js +13 -13
- package/dist/modules/customer_accounts/services/customerTokenService.js.map +2 -2
- package/dist/modules/customer_accounts/services/customerUserService.js +1 -1
- package/dist/modules/customer_accounts/services/customerUserService.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js +44 -51
- package/dist/modules/customer_accounts/subscribers/autoLinkCrm.js.map +2 -2
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmOnVerification.js +12 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmOnVerification.js.map +7 -0
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js +3 -1
- package/dist/modules/customer_accounts/subscribers/autoLinkCrmReverse.js.map +2 -2
- package/dist/modules/customer_accounts/workers/cleanupExpiredTokens.js +6 -0
- package/dist/modules/customer_accounts/workers/cleanupExpiredTokens.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/PasswordForm.js +127 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/PasswordForm.js.map +7 -0
- package/dist/modules/portal/frontend/[orgSlug]/portal/reset-password/page.js +10 -122
- package/dist/modules/portal/frontend/[orgSlug]/portal/reset-password/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js +2 -11
- package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js.map +2 -2
- package/dist/modules/portal/frontend/[orgSlug]/portal/verify/page.js +3 -61
- package/dist/modules/portal/frontend/[orgSlug]/portal/verify/page.js.map +2 -2
- package/package.json +7 -7
- package/src/modules/customer_accounts/api/admin/users/[id]/verify-email.ts +11 -33
- package/src/modules/customer_accounts/api/email/verify.ts +15 -11
- package/src/modules/customer_accounts/api/magic-link/verify.ts +9 -9
- package/src/modules/customer_accounts/api/password/reset-confirm.ts +13 -18
- package/src/modules/customer_accounts/api/signup.ts +36 -24
- package/src/modules/customer_accounts/data/validators.ts +2 -1
- package/src/modules/customer_accounts/lib/customerAuth.ts +12 -10
- package/src/modules/customer_accounts/lib/customerAuthServer.ts +7 -7
- package/src/modules/customer_accounts/lib/pendingSignup.ts +12 -0
- package/src/modules/customer_accounts/lib/verifyCustomerEmail.ts +57 -0
- package/src/modules/customer_accounts/services/customerInvitationService.ts +16 -1
- package/src/modules/customer_accounts/services/customerTokenService.ts +13 -13
- package/src/modules/customer_accounts/services/customerUserService.ts +2 -2
- package/src/modules/customer_accounts/subscribers/autoLinkCrm.ts +46 -78
- package/src/modules/customer_accounts/subscribers/autoLinkCrmOnVerification.ts +9 -0
- package/src/modules/customer_accounts/subscribers/autoLinkCrmReverse.ts +3 -1
- package/src/modules/customer_accounts/workers/cleanupExpiredTokens.ts +7 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/PasswordForm.tsx +182 -0
- package/src/modules/portal/frontend/[orgSlug]/portal/reset-password/page.tsx +9 -165
- package/src/modules/portal/frontend/[orgSlug]/portal/signup/page.tsx +2 -12
- package/src/modules/portal/frontend/[orgSlug]/portal/verify/page.tsx +3 -89
- package/src/modules/portal/i18n/de.json +2 -1
- package/src/modules/portal/i18n/en.json +2 -1
- package/src/modules/portal/i18n/es.json +2 -1
- package/src/modules/portal/i18n/ko.json +2 -1
- package/src/modules/portal/i18n/pl.json +2 -1
|
@@ -1,92 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
import {
|
|
3
|
-
import Link from 'next/link'
|
|
4
|
-
import { useSearchParams } from 'next/navigation'
|
|
5
|
-
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
6
|
-
import { apiCall } from '@open-mercato/ui/backend/utils/apiCall'
|
|
7
|
-
import { Button } from '@open-mercato/ui/primitives/button'
|
|
8
|
-
import { Alert, AlertDescription } from '@open-mercato/ui/primitives/alert'
|
|
9
|
-
import { Spinner } from '@open-mercato/ui/primitives/spinner'
|
|
2
|
+
import { PortalPasswordForm } from '../PasswordForm'
|
|
10
3
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type VerifyState = 'verifying' | 'success' | 'error'
|
|
14
|
-
|
|
15
|
-
export default function PortalVerifyPage({ params }: Props) {
|
|
16
|
-
const t = useT()
|
|
17
|
-
const searchParams = useSearchParams()
|
|
18
|
-
const token = searchParams.get('token') ?? ''
|
|
19
|
-
const [state, setState] = useState<VerifyState>(token ? 'verifying' : 'error')
|
|
20
|
-
const [error, setError] = useState<string | null>(token ? null : t('portal.verify.error.invalidToken', 'Verification token is missing.'))
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
if (!token) return
|
|
24
|
-
|
|
25
|
-
let active = true
|
|
26
|
-
|
|
27
|
-
void apiCall<{ ok: boolean; error?: string }>('/api/customer_accounts/email/verify', {
|
|
28
|
-
method: 'POST',
|
|
29
|
-
headers: { 'Content-Type': 'application/json' },
|
|
30
|
-
body: JSON.stringify({ token }),
|
|
31
|
-
}).then((result) => {
|
|
32
|
-
if (!active) return
|
|
33
|
-
if (result.ok && result.result?.ok) {
|
|
34
|
-
setState('success')
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
setState('error')
|
|
39
|
-
setError(result.result?.error || t('portal.verify.error.generic', 'Email verification failed. Please try again.'))
|
|
40
|
-
}).catch(() => {
|
|
41
|
-
if (!active) return
|
|
42
|
-
setState('error')
|
|
43
|
-
setError(t('portal.verify.error.generic', 'Email verification failed. Please try again.'))
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
return () => {
|
|
47
|
-
active = false
|
|
48
|
-
}
|
|
49
|
-
}, [token, t])
|
|
50
|
-
|
|
51
|
-
if (state === 'verifying') {
|
|
52
|
-
return (
|
|
53
|
-
<div className="mx-auto flex max-w-sm flex-col items-center gap-4 py-12 text-center">
|
|
54
|
-
<Spinner />
|
|
55
|
-
<div>
|
|
56
|
-
<h1 className="text-2xl font-bold tracking-tight">{t('portal.verify.title', 'Verifying email')}</h1>
|
|
57
|
-
<p className="mt-1.5 text-sm text-muted-foreground">{t('portal.verify.description', 'Please wait while we verify your email address.')}</p>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (state === 'success') {
|
|
64
|
-
return (
|
|
65
|
-
<div className="mx-auto flex max-w-sm flex-col items-center gap-4 py-12 text-center">
|
|
66
|
-
<div className="mx-auto flex size-12 items-center justify-center rounded-full bg-foreground text-background">
|
|
67
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="size-6">
|
|
68
|
-
<polyline points="20 6 9 17 4 12" />
|
|
69
|
-
</svg>
|
|
70
|
-
</div>
|
|
71
|
-
<div>
|
|
72
|
-
<h1 className="text-2xl font-bold tracking-tight">{t('portal.verify.success.title', 'Email verified')}</h1>
|
|
73
|
-
<p className="mt-1.5 text-sm text-muted-foreground">{t('portal.verify.success.description', 'Your email has been verified. You can now sign in to the portal.')}</p>
|
|
74
|
-
</div>
|
|
75
|
-
<Button asChild className="w-full rounded-lg">
|
|
76
|
-
<Link href={`/${params.orgSlug}/portal/login`}>{t('portal.verify.success.loginLink', 'Sign In')}</Link>
|
|
77
|
-
</Button>
|
|
78
|
-
</div>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<div className="mx-auto flex max-w-sm flex-col gap-4 py-12">
|
|
84
|
-
<Alert status="error">
|
|
85
|
-
<AlertDescription>{error || t('portal.verify.error.generic', 'Email verification failed. Please try again.')}</AlertDescription>
|
|
86
|
-
</Alert>
|
|
87
|
-
<Button asChild variant="outline" className="rounded-lg">
|
|
88
|
-
<Link href={`/${params.orgSlug}/portal/login`}>{t('portal.verify.error.backToLogin', 'Back to sign in')}</Link>
|
|
89
|
-
</Button>
|
|
90
|
-
</div>
|
|
91
|
-
)
|
|
4
|
+
export default function PortalVerifyPage({ params }: { params: { orgSlug: string } }) {
|
|
5
|
+
return <PortalPasswordForm params={params} verify />
|
|
92
6
|
}
|
|
@@ -144,8 +144,9 @@
|
|
|
144
144
|
"portal.verify.error.backToLogin": "Zurück zur Anmeldung",
|
|
145
145
|
"portal.verify.error.generic": "Die E-Mail-Bestätigung ist fehlgeschlagen. Bitte versuchen Sie es erneut.",
|
|
146
146
|
"portal.verify.error.invalidToken": "Das Bestätigungs-Token fehlt.",
|
|
147
|
+
"portal.verify.submit": "E-Mail-Adresse bestätigen und Passwort festlegen",
|
|
147
148
|
"portal.verify.success.description": "Ihre E-Mail-Adresse wurde bestätigt. Sie können sich jetzt im Portal anmelden.",
|
|
148
149
|
"portal.verify.success.loginLink": "Anmelden",
|
|
149
150
|
"portal.verify.success.title": "E-Mail bestätigt",
|
|
150
|
-
"portal.verify.title": "E-Mail
|
|
151
|
+
"portal.verify.title": "E-Mail-Adresse bestätigen"
|
|
151
152
|
}
|
|
@@ -144,8 +144,9 @@
|
|
|
144
144
|
"portal.verify.error.backToLogin": "Back to sign in",
|
|
145
145
|
"portal.verify.error.generic": "Email verification failed. Please try again.",
|
|
146
146
|
"portal.verify.error.invalidToken": "Verification token is missing.",
|
|
147
|
+
"portal.verify.submit": "Verify email and set password",
|
|
147
148
|
"portal.verify.success.description": "Your email has been verified. You can now sign in to the portal.",
|
|
148
149
|
"portal.verify.success.loginLink": "Sign In",
|
|
149
150
|
"portal.verify.success.title": "Email verified",
|
|
150
|
-
"portal.verify.title": "
|
|
151
|
+
"portal.verify.title": "Verify email"
|
|
151
152
|
}
|
|
@@ -144,8 +144,9 @@
|
|
|
144
144
|
"portal.verify.error.backToLogin": "Volver a iniciar sesión",
|
|
145
145
|
"portal.verify.error.generic": "La verificación del correo electrónico falló. Inténtalo de nuevo.",
|
|
146
146
|
"portal.verify.error.invalidToken": "Falta el token de verificación.",
|
|
147
|
+
"portal.verify.submit": "Verificar correo electrónico y establecer contraseña",
|
|
147
148
|
"portal.verify.success.description": "Su correo electrónico ha sido verificado. Ahora puede iniciar sesión en el portal.",
|
|
148
149
|
"portal.verify.success.loginLink": "Iniciar sesión",
|
|
149
150
|
"portal.verify.success.title": "Correo verificado",
|
|
150
|
-
"portal.verify.title": "
|
|
151
|
+
"portal.verify.title": "Verificar correo electrónico"
|
|
151
152
|
}
|
|
@@ -144,8 +144,9 @@
|
|
|
144
144
|
"portal.verify.error.backToLogin": "로그인으로 돌아가기",
|
|
145
145
|
"portal.verify.error.generic": "이메일 인증에 실패했습니다. 다시 시도해 주세요.",
|
|
146
146
|
"portal.verify.error.invalidToken": "인증 토큰이 없습니다.",
|
|
147
|
+
"portal.verify.submit": "이메일 인증 및 비밀번호 설정",
|
|
147
148
|
"portal.verify.success.description": "이메일 인증이 완료되었습니다. 이제 포털에 로그인할 수 있습니다.",
|
|
148
149
|
"portal.verify.success.loginLink": "로그인",
|
|
149
150
|
"portal.verify.success.title": "이메일 인증 완료",
|
|
150
|
-
"portal.verify.title": "이메일 인증
|
|
151
|
+
"portal.verify.title": "이메일 인증"
|
|
151
152
|
}
|
|
@@ -144,8 +144,9 @@
|
|
|
144
144
|
"portal.verify.error.backToLogin": "Wróć do logowania",
|
|
145
145
|
"portal.verify.error.generic": "Weryfikacja adresu e-mail nie powiodła się. Spróbuj ponownie.",
|
|
146
146
|
"portal.verify.error.invalidToken": "Brakuje tokenu weryfikacyjnego.",
|
|
147
|
+
"portal.verify.submit": "Zweryfikuj adres e-mail i ustaw hasło",
|
|
147
148
|
"portal.verify.success.description": "Twój adres e-mail został zweryfikowany. Możesz teraz zalogować się do portalu.",
|
|
148
149
|
"portal.verify.success.loginLink": "Zaloguj się",
|
|
149
150
|
"portal.verify.success.title": "Adres e-mail zweryfikowany",
|
|
150
|
-
"portal.verify.title": "
|
|
151
|
+
"portal.verify.title": "Zweryfikuj adres e-mail"
|
|
151
152
|
}
|