public function ServerController::serverBypassEnable in OAuth2 Server 8
Same name and namespace in other branches
- 2.0.x src/Controller/ServerController.php \Drupal\oauth2_server\Controller\ServerController::serverBypassEnable()
Enables a OAuth2 server without a confirmation form.
Parameters
\Drupal\oauth2_server\ServerInterface $oauth2_server: The server to be enabled.
Return value
\Symfony\Component\HttpFoundation\Response The response to send to the browser.
Throws
\Drupal\Core\Entity\EntityStorageException
1 string reference to 'ServerController::serverBypassEnable'
File
- src/
Controller/ ServerController.php, line 26
Class
- ServerController
- Class Server Controller.
Namespace
Drupal\oauth2_server\ControllerCode
public function serverBypassEnable(ServerInterface $oauth2_server) {
$oauth2_server
->setStatus(TRUE)
->save();
// Notify the user about the status change.
$this
->messenger()
->addMessage($this
->t('The OAuth2 server %name has been enabled.', [
'%name' => $oauth2_server
->label(),
]));
return $this
->redirect('oauth2_server.overview');
}