public function FakeAuthorizationController::authorize in Lingotek Translation 3.7.x
Same name and namespace in other branches
- 8 tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 8.2 tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 4.0.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.0.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.1.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.2.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.3.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.4.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.5.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.6.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
- 3.8.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php \Drupal\lingotek_test\Controller\FakeAuthorizationController::authorize()
1 string reference to 'FakeAuthorizationController::authorize'
- lingotek_test.routing.yml in tests/modules/ lingotek_test/ lingotek_test.routing.yml 
- tests/modules/lingotek_test/lingotek_test.routing.yml
File
- tests/modules/ lingotek_test/ src/ Controller/ FakeAuthorizationController.php, line 16 
Class
Namespace
Drupal\lingotek_test\ControllerCode
public function authorize(Request $request) {
  // We need a flag for setting that we are already logged in.
  \Drupal::state()
    ->set('lingotek_fake.logged_in', TRUE);
  // We provide a token and redirect back.
  $url = $request
    ->get('redirect_uri');
  $url .= '#access_token=' . self::ACCESS_TOKEN;
  // JavaScript would take the token and post it to the same url. This is replaced below.
  $this
    ->handleHandshake($request);
  return new RedirectResponse($url);
}