From 4156c570154913afaff2e70db68f99633a16b493 Mon Sep 17 00:00:00 2001 From: Kakabay <2kakabayashyrberdyew@gmail.com> Date: Wed, 8 Jan 2025 18:48:04 +0500 Subject: [PATCH] auth not authenticated fixed --- components/lottery/auth/LotteryAuthForm.tsx | 6 +++++- models/lottery/lottery.model.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/lottery/auth/LotteryAuthForm.tsx b/components/lottery/auth/LotteryAuthForm.tsx index a6e982e..16eb910 100644 --- a/components/lottery/auth/LotteryAuthForm.tsx +++ b/components/lottery/auth/LotteryAuthForm.tsx @@ -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'); diff --git a/models/lottery/lottery.model.ts b/models/lottery/lottery.model.ts index c516cf6..fd55a0d 100644 --- a/models/lottery/lottery.model.ts +++ b/models/lottery/lottery.model.ts @@ -20,4 +20,5 @@ export interface ILotteryData { export interface ILotteryResponse { data: ILotteryData; user_lottery_numbers: string[]; + errorMessage?: string; }