OIDC - Specifically check for 401 status before resetting (#3500)

This commit is contained in:
Carter 2024-04-19 09:51:04 -05:00 committed by GitHub
parent 3373abf787
commit 2b6d7811ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,8 +77,10 @@ export default class DynamicOpenIDConnectScheme extends OpenIDConnectScheme {
})
// Update tokens with mealie token
this.updateTokens(response)
} catch {
this.$auth.reset()
} catch (e) {
if (e.response?.status === 401) {
this.$auth.reset()
}
const currentUrl = new URL(window.location.href)
if (currentUrl.pathname === "/login" && currentUrl.searchParams.has("direct")) {
return