From 466a72f3a0435177e744583c926f3b83f3cf7db0 Mon Sep 17 00:00:00 2001 From: Shah Shalin Date: Tue, 26 Nov 2024 13:19:56 +0530 Subject: [PATCH] Fix: Redirect to login page when reauth parameter is present and user is logged in - Added check for 'reauth' parameter in the URL. - Redirect to the login page if the user is already logged in. --- login-with-google.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/login-with-google.php b/login-with-google.php index 5fdd52c1..9d80d6b5 100644 --- a/login-with-google.php +++ b/login-with-google.php @@ -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; }