rtCamp / login-with-google

Minimal plugin which allows WordPress user to login with google.
https://wordpress.org/plugins/login-with-google/
GNU General Public License v2.0
57 stars 17 forks source link

Shortcode redirect_to parameter not working #154

Open kvveltho opened 1 year ago

kvveltho commented 1 year ago

echo do_shortcode(' [google_login button_text="Aanmelden met Google" force_display="yes" redirect_to = "https://beta.fastfiber.be/mijn-account" ]');

Nomatter which url we set in redirect_to parameter of the shortcode the redirect_uri is always set to wp_login_url:

Error 400: redirect_uri_mismatch You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy. If you're the app developer, register the redirect URI in the Google Cloud Console. Request details: redirect_uri=https://beta.fastfiber.be/jhd86

In Container.php this part of the code is not taking in consideration the shortcode parameter: return new GoogleClient( [ 'client_id' => $settings->client_id, 'client_secret' => $settings->client_secret, // 'redirect_uri' => 'https://beta.fastfiber.be/mijn-account/subscription_custom/', 'redirect_uri' => wp_login_url(), ] );