feat : update
This commit is contained in:
@@ -157,7 +157,7 @@ export function AccountForm({
|
||||
fetchOptions: { headers: captcha ? { "x-captcha-response": token } : undefined },
|
||||
});
|
||||
if (result.error?.code === "EMAIL_NOT_VERIFIED") {
|
||||
router.push(`/check-email?email=${encodeURIComponent(email)}&next=${encodeURIComponent(nextPath)}`);
|
||||
router.push(`/auth/check-email?email=${encodeURIComponent(email)}&next=${encodeURIComponent(nextPath)}`);
|
||||
return;
|
||||
}
|
||||
if (result.error) throw new Error(result.error.message ?? "เข้าสู่ระบบไม่สำเร็จ");
|
||||
@@ -262,15 +262,15 @@ export function AccountForm({
|
||||
</FieldGroup>
|
||||
</form>
|
||||
{register ? <Button variant="link" nativeButton={false}
|
||||
render={<Link href={`/login${nextPath === "/" ? "" : `?next=${encodeURIComponent(nextPath)}`}`} />}>
|
||||
render={<Link href={`/auth/login${nextPath === "/" ? "" : `?next=${encodeURIComponent(nextPath)}`}`} />}>
|
||||
มีบัญชีแล้ว? เข้าสู่ระบบ
|
||||
</Button> : <div className="flex items-center justify-between gap-2">
|
||||
<Button variant="link" size="sm" className="px-0" nativeButton={false}
|
||||
render={<Link href={`/register${nextPath === "/" ? "" : `?next=${encodeURIComponent(nextPath)}`}`} />}>
|
||||
render={<Link href={`/auth/register${nextPath === "/" ? "" : `?next=${encodeURIComponent(nextPath)}`}`} />}>
|
||||
สมัครสมาชิก
|
||||
</Button>
|
||||
<Button variant="link" size="sm" className="px-0" nativeButton={false}
|
||||
render={<Link href="/forgot-password" />}>
|
||||
render={<Link href="/auth/forgot-password" />}>
|
||||
ลืมรหัสผ่าน?
|
||||
</Button>
|
||||
</div>}
|
||||
|
||||
@@ -17,7 +17,7 @@ export function AccountMenu({ admin = false }: { admin?: boolean }) {
|
||||
async function signOut() {
|
||||
await unsubscribeCommissionPush().catch(() => undefined);
|
||||
await authClient.signOut();
|
||||
router.push(admin ? "/login?next=%2Fadmin" : "/commission");
|
||||
router.push(admin ? "/auth/login?next=%2Fadmin" : "/commission");
|
||||
router.refresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ export function EmailActionForm({ mode, token = "", invalidToken = false }: {
|
||||
setError("");
|
||||
try {
|
||||
if (mode === "forgot") {
|
||||
const result = await authClient.requestPasswordReset({ email: address, redirectTo: "/reset-password" });
|
||||
const result = await authClient.requestPasswordReset({ email: address, redirectTo: "/auth/password-reset" });
|
||||
if (result.error) throw new Error("ส่งลิงก์รีเซ็ตไม่สำเร็จ กรุณาลองอีกครั้ง");
|
||||
} else {
|
||||
const password = String(form.get("password") ?? "");
|
||||
@@ -74,10 +74,10 @@ export function EmailActionForm({ mode, token = "", invalidToken = false }: {
|
||||
mode === "forgot" ? "ส่งลิงก์รีเซ็ต" : "ตั้งรหัสผ่าน"}</Button>
|
||||
</FieldGroup>
|
||||
</form>}
|
||||
{mode === "reset" && !token && <Button variant="link" nativeButton={false} render={<Link href="/forgot-password" />}>
|
||||
{mode === "reset" && !token && <Button variant="link" nativeButton={false} render={<Link href="/auth/forgot-password" />}>
|
||||
ขอลิงก์รีเซ็ตใหม่
|
||||
</Button>}
|
||||
<Button variant="link" nativeButton={false} render={<Link href="/login" />}>กลับไปเข้าสู่ระบบ</Button>
|
||||
<Button variant="link" nativeButton={false} render={<Link href="/auth/login" />}>กลับไปเข้าสู่ระบบ</Button>
|
||||
</CardContent>
|
||||
</Card>;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ export function RegistrationOtpForm({ email, nextPath, setup }: {
|
||||
<Button variant="link" onClick={resend} disabled={busy || sending}>
|
||||
{sending ? "กำลังส่ง..." : "ส่งรหัสใหม่"}
|
||||
</Button>
|
||||
<Button variant="link" nativeButton={false} render={<Link href="/login" />}>กลับไปเข้าสู่ระบบ</Button>
|
||||
<Button variant="link" nativeButton={false} render={<Link href="/auth/login" />}>กลับไปเข้าสู่ระบบ</Button>
|
||||
</CardContent>
|
||||
</Card>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user