forked from Transparency/kgroad-frontend2
resolved
This commit is contained in:
commit
e2db27b56f
27 files changed
+952
-429
No files matched your search
@@ -25,6 +25,7 @@ const refreshToken = async (token: JWT): Promise<JWT> => {
|
||||
// const date = new Date().toLocaleTimeString();
|
||||
// const expire = new Date(token.expires_in).toLocaleTimeString();
|
||||
|
||||
<<<<<<< HEAD
|
||||
const verify = await verifyToken(token.access_token);
|
||||
|
||||
if (verify)
|
||||
@@ -34,6 +35,10 @@ const refreshToken = async (token: JWT): Promise<JWT> => {
|
||||
|
||||
const response = await apiInstance.post<IRefresh>(
|
||||
"/users/refresh/",
|
||||
=======
|
||||
const response = await axios.post<IToken>(
|
||||
"https://api.kgroad.org/api/v1/token/refresh/",
|
||||
>>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1
|
||||
data
|
||||
);
|
||||
|
||||
@@ -66,7 +71,23 @@ export const authConfig: AuthOptions = {
|
||||
password,
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
const res = await apiInstance.post("/users/login/", data);
|
||||
=======
|
||||
const res = await fetch(
|
||||
"https://api.kgroad.org/api/v1/users/login/",
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
email,
|
||||
password,
|
||||
}),
|
||||
}
|
||||
);
|
||||
>>>>>>> d1440f3907ca91b29db2977f043e44f54993aeb1
|
||||
|
||||
if (![200, 201].includes(res.status)) {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user