fix: set token before making auth verify request
This commit is contained in:
@@ -53,8 +53,8 @@ class ApiClient {
|
|||||||
// Auth
|
// Auth
|
||||||
async login(token) {
|
async login(token) {
|
||||||
try {
|
try {
|
||||||
|
this.setToken(token); // Set token BEFORE making request
|
||||||
const data = await this.get('/auth/verify');
|
const data = await this.get('/auth/verify');
|
||||||
this.setToken(token);
|
|
||||||
return data;
|
return data;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.setToken(null);
|
this.setToken(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user