mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-08-18 13:03:17 +00:00
[Web] Minor hardening across web UI and nginx
This commit is contained in:
@@ -4,6 +4,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
||||
if (!isset($_SESSION['mailcow_cc_role'])) {
|
||||
$_SESSION['oauth2_request'] = $_SERVER['REQUEST_URI'];
|
||||
header('Location: /?oauth');
|
||||
exit;
|
||||
}
|
||||
|
||||
$request = OAuth2\Request::createFromGlobals();
|
||||
@@ -24,6 +25,11 @@ if (!isset($_POST['authorized'])) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($_SESSION['mailcow_cc_username'])) {
|
||||
header('Location: /?oauth');
|
||||
exit;
|
||||
}
|
||||
|
||||
// print the authorization code if the user has authorized your client
|
||||
$is_authorized = ($_POST['authorized'] == '1');
|
||||
$oauth2_server->handleAuthorizeRequest($request, $response, $is_authorized, $_SESSION['mailcow_cc_username']);
|
||||
|
||||
Reference in New Issue
Block a user