arch: move web folder into api & move api to top level
This commit is contained in:
17
frontend/src/shared/utils/accessToken.ts
Normal file
17
frontend/src/shared/utils/accessToken.ts
Normal file
@ -0,0 +1,17 @@
|
||||
let accessToken = '';
|
||||
|
||||
export function setAccessToken(newToken: string) {
|
||||
accessToken = newToken;
|
||||
}
|
||||
export function getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
export async function getNewToken() {
|
||||
return fetch('http://localhost:3333/auth/refresh_token', {
|
||||
method: 'POST',
|
||||
credentials: 'include',
|
||||
}).then(x => {
|
||||
return x.json();
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user