|
|
|
@ -26,7 +26,7 @@ export const useAuthorization = ({ onSentCode, onConfirmCode }: IParams) => {
@@ -26,7 +26,7 @@ export const useAuthorization = ({ onSentCode, onConfirmCode }: IParams) => {
|
|
|
|
|
if (isForbidden) setFirbiddenError() |
|
|
|
|
}, [isForbidden]) |
|
|
|
|
|
|
|
|
|
const sendCode = async (phoneNumber: string) => { |
|
|
|
|
const sendCode = async (phoneNumber: string, isResend: boolean = false) => { |
|
|
|
|
setLoading(true) |
|
|
|
|
try { |
|
|
|
|
if (!phoneNumber) { |
|
|
|
@ -34,7 +34,7 @@ export const useAuthorization = ({ onSentCode, onConfirmCode }: IParams) => {
@@ -34,7 +34,7 @@ export const useAuthorization = ({ onSentCode, onConfirmCode }: IParams) => {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await authService.sendConfirmationCode(phoneNumber) |
|
|
|
|
await authService.sendConfirmationCode(phoneNumber, isResend) |
|
|
|
|
if (onSentCode) onSentCode() |
|
|
|
|
clearError() |
|
|
|
|
} catch (e: any) { |
|
|
|
|