Skip to content

v0.2.3 - OAuth Callback Improvements

Choose a tag to compare

@kbrookes kbrookes released this 25 Nov 03:59
· 17 commits to main since this release

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_uri filter 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:

  1. Check the redirect URI on the Settings page matches exactly what's in Google Cloud Console
  2. Enable debug logging in wp-config.php:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  3. Check debug.log for lines starting with NVM OAuth to see what's failing
  4. 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;
} );