Support for Multiple Redirect URIs Based on Environment (localhost and production) #140
Hamzah-syed
started this conversation in
Ideas
Replies: 2 comments
-
I also experienced similar issue. I only could test it on production or had to manually change the redirect url to localhost:3000 to test the login. It is something for sure to improve. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @Hamzah-syed - this is a great idea for a feature request! In the meantime, you can use the E.g. (theorycraft since I'm responding via phone): add_filter(
'graphql_login_provider_settings',
static function( $settings, $provider_slug ) {
if ( 'development' === wp_get_environment_type() {
$settings['redirectUri'] = 'https://sandbox.uri.local' // or whatevever
}
return $settings;
},
10,
2
); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I’m currently using the
wp-graphql-headless-login
plugin for social login, but I’m facing an issue when trying to configure multiple redirect URIs for oAuth. Specifically, I need to be able to use different redirect URIs based on the environment:Development Environment:
Frontend URL: http://localhost:3000
Redirect URI: http://localhost:3000/api/auth/login/google
Production Environment:
Frontend URL: https://www.example.com
Redirect URI: https://www.example.com/api/auth/login/google
Issue: Right now, the plugin allows only one redirect URI in its settings. This causes a redirect_uri_mismatch error when I try to log in from my development environment (localhost).
Beta Was this translation helpful? Give feedback.
All reactions