complated project

This commit is contained in:
Samandar Turgunboyev
2026-02-02 18:51:53 +05:00
parent f0183e4573
commit a7419929f8
57 changed files with 3035 additions and 477 deletions

View File

@@ -21,6 +21,7 @@ import {
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { SafeAreaView } from 'react-native-safe-area-context';
import { auth_api } from '../login/lib/api';
import useTokenStore from '../login/lib/hook';
import ConfirmForm from './ConfirmForm';
const RegisterConfirmScreen = () => {
@@ -28,6 +29,7 @@ const RegisterConfirmScreen = () => {
const [phoneOTP, setPhone] = useState<string | null>('');
const [error, setError] = useState<string>('');
const { login } = useAuth();
const { savedToken } = useTokenStore();
const [resendTimer, setResendTimer] = useState<number>(60);
@@ -59,6 +61,7 @@ const RegisterConfirmScreen = () => {
onSuccess: async (res) => {
await AsyncStorage.removeItem('phone');
await AsyncStorage.setItem('access_token', res.data.data.token.access);
savedToken(res.data.data.token.access);
await AsyncStorage.setItem('refresh_token', res.data.data.token.refresh);
await login(res.data.data.token.access);
router.replace('/(dashboard)');