Google_Calendar_Helpers::has_missing_scopes( mixed $token )
Method has_missing_scopes.
Contents
Description Description
Checks if the user has missing scopes. Scopes are checked during OAuth consent screen.
Parameters Parameters
- $token
-
(Required) The access token combination.
Return Return
(boolean) True if there are scopes missing. Otherwise, false.
Source Source
File: src/integrations/google-calendar/helpers/google-calendar-helpers.php
public function has_missing_scopes( $token ) { if ( ! isset( $token['scope'] ) || empty( $token['scope'] ) ) { return true; } $scopes = array( 'https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/calendar.events', ); $has_missing_scope = false; foreach ( $scopes as $scope ) { if ( ! str_contains( $token['scope'], $scope ) ) { $has_missing_scope = true; } } return $has_missing_scope; }
Expand full source code Collapse full source code View on Github