Google OAuth
Overview
Implements Google OAuth login and account creation for Spawn customers.
Constants
GOOGLE_AUTH_URLGOOGLE_TOKEN_URLGOOGLE_USERINFO_URL
Configuration
spawn_google_client_idspawn_google_client_secret
Methods
is_configured(): boolreturns whether credentials are set.get_auth_url(): stringbuilds the OAuth authorization URL.exchange_code_for_token( string $code ): array|WP_Errorget_user_info( string $access_token ): array|WP_Errorfind_or_create_user( array $google_user ): int|WP_Error
Example
php
if ( SpawnGoogle_OAuth::is_configured() ) {
$auth_url = SpawnGoogle_OAuth::get_auth_url();
}