Fixed expiry calls
This commit is contained in:
@@ -47,13 +47,12 @@ const TokenProvider = props => {
|
|||||||
//save the new auth stuff (setting bearer as well)
|
//save the new auth stuff (setting bearer as well)
|
||||||
const newAuth = await response.json();
|
const newAuth = await response.json();
|
||||||
|
|
||||||
setAccess(newAuth.accessToken);
|
setAccessToken(newAuth.accessToken);
|
||||||
setRefresh(newAuth.refreshToken);
|
setRefreshToken(newAuth.refreshToken);
|
||||||
bearer = newAuth.accessToken;
|
bearer = newAuth.accessToken;
|
||||||
|
|
||||||
//BUGFIX: logging out correctly requires the new refresh token
|
//BUGFIX: logging out correctly requires the new refresh token
|
||||||
if (url == `${process.env.AUTH_URI}/logout`) {
|
if (url == `${process.env.AUTH_URI}/logout`) {
|
||||||
console.log(`logging out with refresh token: ${newAuth.refreshToken}`)
|
|
||||||
return fetch(`${process.env.AUTH_URI}/logout`, {
|
return fetch(`${process.env.AUTH_URI}/logout`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user