mirror of
https://github.com/nextcloud/server.git
synced 2026-03-04 18:28:08 +01:00
Throw an exception when login is canceled by an app
This commit is contained in:
25
lib/base.php
25
lib/base.php
@@ -844,19 +844,24 @@ class OC {
|
||||
protected static function handleLogin() {
|
||||
OC_App::loadApps(array('prelogin'));
|
||||
$error = array();
|
||||
$messages = [];
|
||||
|
||||
// auth possible via apache module?
|
||||
if (OC::tryApacheAuth()) {
|
||||
$error[] = 'apacheauthfailed';
|
||||
} // remember was checked after last login
|
||||
elseif (OC::tryRememberLogin()) {
|
||||
$error[] = 'invalidcookie';
|
||||
} // logon via web form
|
||||
elseif (OC::tryFormLogin()) {
|
||||
$error[] = 'invalidpassword';
|
||||
try {
|
||||
// auth possible via apache module?
|
||||
if (OC::tryApacheAuth()) {
|
||||
$error[] = 'apacheauthfailed';
|
||||
} // remember was checked after last login
|
||||
elseif (OC::tryRememberLogin()) {
|
||||
$error[] = 'invalidcookie';
|
||||
} // logon via web form
|
||||
elseif (OC::tryFormLogin()) {
|
||||
$error[] = 'invalidpassword';
|
||||
}
|
||||
} catch (\OC\User\LoginException $e) {
|
||||
$messages[] = $e->getMessage();
|
||||
}
|
||||
|
||||
OC_Util::displayLoginPage(array_unique($error));
|
||||
OC_Util::displayLoginPage(array_unique($error), $messages);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user