mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Clean up login since state no longer tracks tokens
This commit is contained in:
parent
a027115836
commit
c4f241f799
2 changed files with 2 additions and 12 deletions
|
@ -67,11 +67,7 @@ export function UserLogin(user: LoginParams) {
|
|||
);
|
||||
setAccessToken(response.data.access);
|
||||
setRefreshToken(response.data.refresh);
|
||||
return [
|
||||
true,
|
||||
JSON.stringify(response.data.access),
|
||||
JSON.stringify(response.data.refresh),
|
||||
];
|
||||
return [true];
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Login Failed:" + error.response.data);
|
||||
|
@ -92,7 +88,7 @@ export async function TokenRefresh() {
|
|||
"Token refresh success! New Access Token",
|
||||
response.data.access
|
||||
);*/
|
||||
return [true, JSON.stringify(response.data.access)];
|
||||
return [true];
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("Refresh Failed: " + JSON.stringify(error.response.data));
|
||||
|
|
|
@ -80,12 +80,6 @@ export default function Login() {
|
|||
}).then((result) => {
|
||||
if (result[0]) {
|
||||
setUser({ ...user, username: "", password: "", error: "" });
|
||||
/*console.log(
|
||||
"Access Token:",
|
||||
result[1],
|
||||
"\nRefresh Token:",
|
||||
result[2]
|
||||
);*/
|
||||
navigation.navigate("Onboarding");
|
||||
} else {
|
||||
setUser({
|
||||
|
|
Loading…
Reference in a new issue