Skip to content

Commit

Permalink
Merge branch 'adjusting-jwt-configuration'
Browse files Browse the repository at this point in the history
  • Loading branch information
mangrose committed Jun 15, 2021
2 parents 72aacf4 + 3537f17 commit 1ec22d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions includes/class-tulo-payway-sso2-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function identify_session() {
"iss" => $organisation_id,
"aud" => "pw-sso",
"nbf" => $time,
"exp" => $time + 10,
"exp" => $time + 60,
"iat" => $time
);

Expand Down Expand Up @@ -296,7 +296,7 @@ protected function logout_user($locallyInitiated=true) {

protected function decode_token($token, $client_secret) {
try {
JWT::$leeway = 60;
JWT::$leeway = 120;
$decoded = JWT::decode($token, $client_secret, array("HS256"));
return $decoded;
} catch(Firebase\JWT\BeforeValidException $e) {
Expand Down
6 changes: 4 additions & 2 deletions landing.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@ function write_log($log) {
}
}
}

$token = $_GET["t"];
$redirect_url = $_GET["r"];

$baseurl = explode( "wp-content" , __FILE__ );
$baseurl = $baseurl[0];
require_once( $baseurl . "wp-load.php" );

use \Firebase\JWT\JWT;

$token = $_GET["t"];
$redirect_url = $_GET["r"];
$client_secret = get_option('tulo_server_secret');
$session = new Tulo_Payway_Session();

Expand Down

0 comments on commit 1ec22d0

Please sign in to comment.