diff --git a/JS/BlueskyAPI.js b/JS/BlueskyAPI.js index 78422e5..30d383d 100644 --- a/JS/BlueskyAPI.js +++ b/JS/BlueskyAPI.js @@ -565,20 +565,13 @@ export async function RefreshTokens() { let Auth = ReauthRequest(WellKnown.token_endpoint, Var, DPoP); let body = await Auth.then((response) => response.json()); let header = await Auth.then((response) => response.headers.get("dpop-nonce")); - if (body.hasOwnProperty("error_description") && body.error_description.includes("DPoP nonce mismatch")) { - localStorage.setItem(Variables.BlueskyNonce, header); - DPoP = await ClientDPoPToken("POST", WellKnown.token_endpoint); - body = await ReauthRequest(WellKnown.token_endpoint, Var, DPoP).then((response) => response.json()); - } // Save the tokens and be done localStorage.setItem(Variables.BlueskyAccessToken, body.access_token); localStorage.setItem(Variables.BlueskyRefreshToken, body.refresh_token); } async function HandleError(body, header) { - if (body.message.includes("DPoP nonce mismatch")) { - await localStorage.setItem(Variables.BlueskyNonce, header); - } + await localStorage.setItem(Variables.BlueskyNonce, header); if (body.message.includes("claim timestamp check failed")) { await RefreshTokens(); }