Commit 77433f09 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1828303: Make sure external auth object exists before calling logout



behatnotneeded

Change-Id: Ia984b9da76ecb8108cef7b20cfdd3a1b7d93108b
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 0aa44264
......@@ -426,7 +426,9 @@ function auth_setup () {
$authinstance = $SESSION->get('authinstance');
if ($authinstance) {
$authobj = AuthFactory::create($authinstance);
$authobj->logout();
if ($authobj) {
$authobj->logout();
}
}
else {
log_debug("Strange: user " . $USER->get('username') . " had no authinstance set in their session");
......@@ -481,8 +483,9 @@ function auth_setup () {
// they're using the local login form
$mnetuser = $USER->get('id');
}
$authobj->logout();
if ($authobj) {
$authobj->logout();
}
$USER->logout();
if ($mnetuser != 0) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment