Skip to content

Commit

Permalink
Merge pull request #273 from theronakpatel/patch-1
Browse files Browse the repository at this point in the history
handle POSTLogout issue to resolve deleting account on SSO
  • Loading branch information
pulsejet authored Apr 15, 2024
2 parents 61e14ad + 9fadd65 commit 888f162
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ public function boot(IBootContext $context): void
// redirecting to the logout url.
$session->set('clearingExecutionContexts', '1');
$session->close();
header('Clear-Site-Data: "cache", "storage"');
if (!$this->isApiRequest()) {
header('Clear-Site-Data: "cache", "storage"');
header('Location: '.$logoutUrl);

header('Location: '.$logoutUrl);

exit;
exit;
}
});
}

Expand Down Expand Up @@ -157,4 +158,9 @@ public function boot(IBootContext $context): void
}
}
}

public function isApiRequest()
{
return isset($_SERVER['HTTP_ACCEPT']) && false !== strpos($_SERVER['HTTP_ACCEPT'], 'application/json');
}
}

0 comments on commit 888f162

Please sign in to comment.