Fixed Errorhandling when switching between Users to display correct Errormessages

This commit is contained in:
Andreas Österreicher
2019-04-12 15:27:17 +02:00
parent 02bab0b301
commit b63809abfd
2 changed files with 5 additions and 8 deletions
+1 -8
View File
@@ -55,14 +55,7 @@ class Login extends FHC_Controller
$this->load->library('AuthLib');
$loginAS = $this->authlib->loginASByUID($uid);
if (isSuccess($loginAS))
{
$this->outputJsonSuccess(true); // obtained!
}
else
{
$this->outputJsonSuccess(getCode($loginAS)); // returns the error code
}
$this->outputJson($loginAS); // returns the error code
}
/**
+4
View File
@@ -80,6 +80,10 @@ class AuthLib
setSessionElement(self::SESSION_NAME, self::SESSION_AUTH_OBJ, getData($loginAS));
}
}
else
{
$loginAS = error('It is not allowed to switch to this user', AUTH_NOT_AUTHENTICATED); // not authenticated by default
}
}
else
{