🐛 fix(API/index.ts): add condition to check if token exists before making the request to renew access token to prevent errors
This commit is contained in:
parent
f44b0e33b1
commit
b832e0844e
1 changed files with 3 additions and 1 deletions
|
|
@ -393,7 +393,9 @@ export async function autoLogin() {
|
||||||
|
|
||||||
export async function renewAccessToken(token: string) {
|
export async function renewAccessToken(token: string) {
|
||||||
try {
|
try {
|
||||||
return await api.post(`${BASE_URL_API}refresh?token=${token}`);
|
if (token) {
|
||||||
|
return await api.post(`${BASE_URL_API}refresh?token=${token}`);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("Error:", error);
|
console.log("Error:", error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue