fix
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import Link from 'next/link';
|
||||
import { FormEvent, useState } from 'react';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { ChevronLeft, UserRound } from 'lucide-react';
|
||||
import { ChevronLeft, DoorOpen, UserRound } from 'lucide-react';
|
||||
import { BrandLogo } from '@/components/id/brand-logo';
|
||||
import { useAuth } from '@/components/id/auth-provider';
|
||||
import { useToast } from '@/components/id/toast-provider';
|
||||
@@ -19,7 +19,7 @@ type Step = 'contact' | 'otp' | 'pin';
|
||||
|
||||
export default function RegisterPage() {
|
||||
const router = useRouter();
|
||||
const { sendLoginOtp, verifyLoginOtp, completePin } = useAuth();
|
||||
const { sendLoginOtp, verifyLoginOtp, completePin, logout } = useAuth();
|
||||
const { showToast } = useToast();
|
||||
const [authTab, setAuthTab] = useState<'email' | 'phone'>('email');
|
||||
const [email, setEmail] = useState('');
|
||||
@@ -166,7 +166,22 @@ export default function RegisterPage() {
|
||||
) : null}
|
||||
|
||||
{step === 'pin' && pendingSessionId ? (
|
||||
<form onSubmit={handlePinSubmit} className="mt-8 space-y-3">
|
||||
<form onSubmit={handlePinSubmit} className="relative mt-8 space-y-3">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
logout();
|
||||
setPendingSessionId(null);
|
||||
setPin('');
|
||||
setStep('contact');
|
||||
}}
|
||||
disabled={isSubmitting}
|
||||
title="Выйти из аккаунта"
|
||||
aria-label="Выйти из аккаунта"
|
||||
className="absolute -top-1 right-0 flex h-9 w-9 items-center justify-center rounded-full text-[#b9bdc9] transition hover:bg-white/10 hover:text-white disabled:opacity-50"
|
||||
>
|
||||
<DoorOpen className="h-4 w-4" />
|
||||
</button>
|
||||
<p className="text-center text-sm text-[#b9bdc9]">Установите PIN для завершения регистрации</p>
|
||||
<PinInput
|
||||
className="h-[58px] border-[#555762] bg-transparent text-center text-lg tracking-[0.4em] text-white placeholder:text-[#8f92a0]"
|
||||
|
||||
Reference in New Issue
Block a user