auth not authenticated fixed
This commit is contained in:
parent
0c9b9224f6
commit
4156c57015
|
|
@ -42,7 +42,11 @@ const LotteryAuthForm = () => {
|
||||||
try {
|
try {
|
||||||
const response = await Queries.authenticateLottery(phone, code);
|
const response = await Queries.authenticateLottery(phone, code);
|
||||||
setAuth(response, 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) {
|
} catch (err) {
|
||||||
console.error('Authentication error:', err);
|
console.error('Authentication error:', err);
|
||||||
setError('Telefon belgisi ýa-da açar nädogry');
|
setError('Telefon belgisi ýa-da açar nädogry');
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,5 @@ export interface ILotteryData {
|
||||||
export interface ILotteryResponse {
|
export interface ILotteryResponse {
|
||||||
data: ILotteryData;
|
data: ILotteryData;
|
||||||
user_lottery_numbers: string[];
|
user_lottery_numbers: string[];
|
||||||
|
errorMessage?: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue