Skip to content

Commit

Permalink
Merge pull request #125 from rtCamp/fix/multiple-redirection-while-login
Browse files Browse the repository at this point in the history
GH-112 : Redirects back to login page after clicking login button
  • Loading branch information
elifvish authored Sep 16, 2022
2 parents 91139c7 + daa554c commit 5854e2b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions login-with-google.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ function container(): Container {
function plugin(): Plugin {
static $plugin;

$reauth = filter_input( INPUT_GET, 'reauth', FILTER_SANITIZE_STRING );
if ( null !== $reauth ) {
if ( ! empty( $_COOKIE[ LOGGED_IN_COOKIE ] ) ) {
wp_safe_redirect( wp_login_url() );
exit;
}
}

if ( null !== $plugin ) {
return $plugin;
}
Expand Down

0 comments on commit 5854e2b

Please sign in to comment.