Redirects to home page after login.

This commit is contained in:
naomi 2018-04-16 13:48:36 +02:00
parent c1cebcbddd
commit b0431c2926

View File

@ -37,3 +37,16 @@ function zencrm_theme() {
function zencrm_page_attachments(array &$page) {
$page['#attached']['library'][] = 'zencrm/opencase-lib';
}
/**
* Implements hook_user_login().
*/
function zencrm_user_login(\Drupal\user\UserInterface $account) {
// Default login destination to the dashboard.
$current_request = \Drupal::service('request_stack')->getCurrentRequest();
if (!$current_request->query->get('destination')) {
$current_request->query->set(
'destination', '/'
);
}
}