mirror of
https://github.com/lemeow125/Reactnative-notesapp.git
synced 2025-04-20 08:51:24 +08:00
Revert "Commiting changes in order to pull initial_front end feature"
This reverts commit c743f6b313
.
This commit is contained in:
parent
c743f6b313
commit
660ac88abc
1 changed files with 0 additions and 21 deletions
|
@ -1,21 +0,0 @@
|
||||||
import axios from "axios";
|
|
||||||
import {
|
|
||||||
LoginParams,
|
|
||||||
} from "../../Interfaces/Interfaces";
|
|
||||||
|
|
||||||
export function UserLogin(user: LoginParams) {
|
|
||||||
return axios
|
|
||||||
.post("http://localhost:8000/api/v1/accounts/token/login/", user)
|
|
||||||
.then(async (response) => {
|
|
||||||
localStorage.setItem("token", JSON.stringify(response.data.auth_token));
|
|
||||||
console.log(
|
|
||||||
"Login Success! Stored Token: ",
|
|
||||||
JSON.parse(localStorage.getItem("token") || "{}")
|
|
||||||
);
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.log("Login Failed: " + error);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue