logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: ac78f801943f22c27cc6e7e9eac7ececb9fa2a5a
parent a1641193b5b7c72e919b9848b167bc4d4a40444b
Author: Alexander Tumin <iamtakingiteasy@eientei.org>
Date:   Mon, 14 Aug 2023 16:21:43 +0300

Fix OAuth2 token lingering after revocation

Diffstat:

Achangelog.d/oauth2-token-linger.fix1+
Msrc/modules/users.js6++++++
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 {