From 9fb22a151578cc581c1ea9d307b0c41b93fe1d31 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 7bee6b2..1848db4 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; }