mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 11:58:06 +08:00
Polished revalidation and login. Opted to not store tokens anymore in state but only in asyncstorage
This commit is contained in:
parent
92b8ce0e4e
commit
a027115836
5 changed files with 14 additions and 20 deletions
|
@ -8,7 +8,6 @@ import {
|
|||
TextInputChangeEventData,
|
||||
} from "react-native";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { setToken } from "../../features/redux/slices/AuthSlice/AuthSlice";
|
||||
import { colors } from "../../styles";
|
||||
import { useState } from "react";
|
||||
import LoginIcon from "../../icons/LoginIcon/LoginIcon";
|
||||
|
@ -87,12 +86,6 @@ export default function Login() {
|
|||
"\nRefresh Token:",
|
||||
result[2]
|
||||
);*/
|
||||
dispatch(
|
||||
setToken({
|
||||
access_token: result[1],
|
||||
refresh_token: result[2],
|
||||
})
|
||||
);
|
||||
navigation.navigate("Onboarding");
|
||||
} else {
|
||||
setUser({
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
import * as React from "react";
|
||||
import styles from "../../styles";
|
||||
import { View, Text, ActivityIndicator } from "react-native";
|
||||
import { TokenRefresh, UserInfo } from "../../components/Api/Api";
|
||||
import {
|
||||
TokenRefresh,
|
||||
UserInfo,
|
||||
setAccessToken,
|
||||
} from "../../components/Api/Api";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { colors } from "../../styles";
|
||||
import { useEffect, useState } from "react";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue