Skip to content

Commit

Permalink
might do the autoredirect?
Browse files Browse the repository at this point in the history
  • Loading branch information
tamw-wnet committed Sep 16, 2024
1 parent 81be3b2 commit da26691
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions assets/js/loginform_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,16 @@ jQuery(document).ready(function($) {
window.location.href = appended_href;
});

// if pmsso exists, just add the pkce code challenge etc and redirect them
if ($(".passport-login-wrap li.pmsso a")) {
console.log('setting verifier');
var code_verifier = generateRandomString();
document.cookie='pkce_code_verifier=' + code_verifier + ';domain=' + window.location.hostname + ';path=/';
var code_challenge = await pkceChallengeFromVerifier(code_verifier);
var encoded_code_challenge = encodeURIComponent(code_challenge);
appended_href = $(this).attr('href') + "&code_challenge=" + encoded_code_challenge + "&code_challenge_method=S256";
window.location.href = appended_href;
}

});

0 comments on commit da26691

Please sign in to comment.