From 521bb30541277f6f5e6d939bf75328a9ce8322a9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 15 Apr 2021 13:02:59 +0200 Subject: [PATCH] Throw "401 Unauthenticated" when authentication is provided but invalid E.g. with an AppToken that has been revoked Signed-off-by: Joas Schilling --- lib/private/User/Session.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index c33d79b83c..5e6501f904 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -599,6 +599,8 @@ class Session implements IUserSession, Emitter { return true; } + // If credentials were provided, they need to be valid, otherwise we do boom + throw new LoginException(); } catch (PasswordLoginForbiddenException $ex) { // Nothing to do }