You are here

function logintoboggan_user_login in LoginToboggan 8

Same name and namespace in other branches
  1. 7 logintoboggan.module \logintoboggan_user_login()

Implements hook_user_login().

File

./logintoboggan.module, line 341
LoginToboggan module.

Code

function logintoboggan_user_login($account) {
  $redirect_on_confirm = \Drupal::config('logintoboggan.settings')
    ->get('redirect_on_confirm');
  $login_message = \Drupal::config('logintoboggan.settings')
    ->get('login_successful_message');
  if ($redirect_on_confirm || $login_message) {
    \Drupal::messenger()
      ->addMessage(t('login successful for %user', [
      '%user' => $account
        ->get('name')->value,
    ]), 'status');
  }
}