auth not authenticated fixed

This commit is contained in:
Kakabay 2025-01-08 18:48:04 +05:00
parent 0c9b9224f6
commit 4156c57015
2 changed files with 6 additions and 1 deletions

View File

@ -42,7 +42,11 @@ const LotteryAuthForm = () => {
try {
const response = await Queries.authenticateLottery(phone, code);
setAuth(response, phone, code);
router.replace('/lottery');
if (response.errorMessage?.length) {
setError('Telefon belgisi ýa-da açar nädogry');
} else {
router.replace('/lottery');
}
} catch (err) {
console.error('Authentication error:', err);
setError('Telefon belgisi ýa-da açar nädogry');

View File

@ -20,4 +20,5 @@ export interface ILotteryData {
export interface ILotteryResponse {
data: ILotteryData;
user_lottery_numbers: string[];
errorMessage?: string;
}