Clean up login since state no longer tracks tokens

This commit is contained in:
Keannu Bernasol 2023-07-04 17:00:22 +08:00
parent a027115836
commit c4f241f799
2 changed files with 2 additions and 12 deletions

View file

@ -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));

View file

@ -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({