v0.2.3 - OAuth Callback Improvements
OAuth Callback Improvements
This release improves OAuth callback handling and error reporting to help diagnose "Unauthorized" errors.
Improvements
- Better error logging: Added extensive logging for OAuth callback issues
- Session handling: Redirect to login if user session is lost during OAuth flow
- Redirect URI filter: Added
nvm_oauth_redirect_urifilter to allow customization for different environments - Settings page: Now shows the exact redirect URI that should be configured in Google Cloud Console
- Error messages: More descriptive error messages for troubleshooting
Troubleshooting "Unauthorized" Errors
If you see "Unauthorized" after returning from Google OAuth:
- Check the redirect URI on the Settings page matches exactly what's in Google Cloud Console
- Enable debug logging in wp-config.php:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );
- Check debug.log for lines starting with
NVM OAuthto see what's failing - Verify you're logged in as an administrator when completing the OAuth flow
For Developers
You can customize the redirect URI for different environments using the filter:
add_filter( 'nvm_oauth_redirect_uri', function( $uri ) {
// Customize for your environment
return $uri;
} );