public function OauthToken::obtainAccess in Commerce Square Connect 8
Controller access method.
Return value
\Drupal\Core\Access\AccessResult The access result.
1 string reference to 'OauthToken::obtainAccess'
File
- src/
Controller/ OauthToken.php, line 41
Class
- OauthToken
- Provides a controller for Square access token retrieval via OAuth.
Namespace
Drupal\commerce_square\ControllerCode
public function obtainAccess() {
// $request is not passed in to _custom_access.
// @see https://www.drupal.org/node/2786941
if (\Drupal::csrfToken()
->validate(\Drupal::request()->query
->get('state'))) {
return AccessResult::allowed();
}
return AccessResult::forbidden('Could not validate state in OAuth validation handshake.');
}