commit: b167025554ec1c1098f17d716e69f8fb0ff795f9
parent 3c041b2ba1db229917e4323041d8be6f42335ace
Author: tusooa <tusooa@kazv.moe>
Date: Sat, 26 Aug 2023 16:57:28 +0000
Merge branch 'fix-oauth2-token-linger' into 'develop'
Fix OAuth2 token lingering after revocation
See merge request pleroma/pleroma-fe!1852
Diffstat:
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/changelog.d/oauth2-token-linger.fix b/changelog.d/oauth2-token-linger.fix
@@ -0,0 +1 @@
+Fix OAuth2 token lingering after revocation
diff --git a/src/modules/users.js b/src/modules/users.js
@@ -651,6 +651,12 @@ const users = {
const response = data.error
// Authentication failed
commit('endLogin')
+
+ // remove authentication token on client/authentication errors
+ if ([400, 401, 403, 422].includes(response.status)) {
+ commit('clearToken')
+ }
+
if (response.status === 401) {
reject(new Error('Wrong username or password'))
} else {