HOTFIX: don't test in prod

This commit is contained in:
2023-12-24 06:43:05 +11:00
parent 288e584cbd
commit 58bc3f6b9d
4 changed files with 15 additions and 10 deletions
+9
View File
@@ -48,6 +48,9 @@ const TokenProvider = props => {
//ping the auth server for a new access token
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${bearer}`
},
credentials: 'include'
});
@@ -79,6 +82,9 @@ const TokenProvider = props => {
//access the refreshed token via callback
const tokenCallback = async (cb) => {
//use this?
let bearer = accessToken;
//if expired (10 minutes, normally)
const expired = new Date(decode(accessToken).exp) < Date.now() / 1000;
@@ -86,6 +92,9 @@ const TokenProvider = props => {
//ping the auth server for a new token
const response = await fetch(`${process.env.AUTH_URI}/auth/token`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${bearer}`
},
credentials: 'include'
});