Selaa lähdekoodia

Merge branch 'fix-oauth2-token-linger' into 'develop'

Fix OAuth2 token lingering after revocation

See merge request pleroma/pleroma-fe!1852
tusooa 1 vuosi sitten
vanhempi
sitoutus
b167025554
2 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 1 0
      changelog.d/oauth2-token-linger.fix
  2. 6 0
      src/modules/users.js

+ 1 - 0
changelog.d/oauth2-token-linger.fix

@@ -0,0 +1 @@
+Fix OAuth2 token lingering after revocation

+ 6 - 0
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 {