Skip to content

Commit

Permalink
feature/redirect-using-cookie-2
Browse files Browse the repository at this point in the history
  • Loading branch information
moreamazingnick committed Sep 5, 2024
1 parent 8c58bdf commit cd6267a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions application/controllers/AuthenticationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public function realmAction(){


if($oidc->authenticate()){
if(isset($_COOKIE['oidc-redirect'])){
if( !empty($_COOKIE['oidc-redirect']) ){
$redirect = $_COOKIE['oidc-redirect'];
setcookie("oidc-redirect", $redirect, time() -3600, "/icingaweb2/");
setcookie("oidc-redirect", "", time() -3600, "/icingaweb2/");
}

$authSuccess=true;
Expand Down
8 changes: 5 additions & 3 deletions library/Oidc/LoginFormModifierHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ class LoginFormModifierHelper
public static function init()
{

$redirect = $_GET['redirect'];
if(! empty($redirect)){
setcookie("oidc-redirect", $redirect, time() + 300, "/icingaweb2/");
if(! empty($_GET['redirect'])){
setcookie("oidc-redirect", $_GET['redirect'], time() + 300, "/icingaweb2/");
}else{
setcookie("oidc-redirect", "", time() -3600, "/icingaweb2/");

}

}
Expand Down
2 changes: 1 addition & 1 deletion module.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: oidc
Version: 0.5.9
Version: 0.6.0
Requires:
Libraries: icinga-php-library (>=0.13.0), icinga-php-thirdparty (>=0.12.0)
Description: oidc
Expand Down

0 comments on commit cd6267a

Please sign in to comment.