FakeAuthorizationController.php in Lingotek Translation 3.3.x
Same filename and directory in other branches
- 8 tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 8.2 tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 4.0.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.0.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.1.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.2.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.4.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.5.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.6.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.7.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
- 3.8.x tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.php
Namespace
Drupal\lingotek_test\ControllerFile
tests/modules/lingotek_test/src/Controller/FakeAuthorizationController.phpView source
<?php
namespace Drupal\lingotek_test\Controller;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
class FakeAuthorizationController extends ControllerBase {
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=test_token';
return new RedirectResponse($url);
}
public function authorizeNoRedirect(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=test_token';
return new RedirectResponse($url);
}
public function createAccountForm(Request $request) {
// We redirect as will happen after clicking cancel on the form.
$url = $request
->get('app');
return new RedirectResponse($url);
}
}
Classes
Name![]() |
Description |
---|---|
FakeAuthorizationController |