Trigger 401 HTTP error on authentication failure instead of 500
This commit is contained in:
parent
11b67c53b3
commit
72abbb7371
1 changed files with 4 additions and 2 deletions
|
@ -446,8 +446,10 @@ class Url {
|
||||||
Tpl :: assign('request', self :: $request );
|
Tpl :: assign('request', self :: $request );
|
||||||
|
|
||||||
// Check authentication (if need)
|
// Check authentication (if need)
|
||||||
if(self :: $request -> authenticated && !Auth::login(true))
|
if(self :: $request -> authenticated && !Auth::login(true)) {
|
||||||
Log :: fatal(I18n::_("Authentication required but fail to authenticate you."));
|
Log :: error(I18n::_("Authentication required but fail to authenticate you."));
|
||||||
|
self :: error_page(null, 401);
|
||||||
|
}
|
||||||
|
|
||||||
Hook::trigger('before_handling_request', array('request' => self :: $request));
|
Hook::trigger('before_handling_request', array('request' => self :: $request));
|
||||||
$success = false;
|
$success = false;
|
||||||
|
|
Loading…
Reference in a new issue