- 🇮🇳India ankitsingh0188 Pune
There's already a code in "hook_user_login" which will validate if there's a destination query param and it's value should not be '/user/login' then will skip the redirection.
/** * Implements hook_user_login(). */ function redirect_after_login_user_login($account) { $current_route = Drupal::routeMatch()->getRouteName(); $request = Drupal::request(); if ($request->getRequestFormat() !== 'html') { return; } $destination = $request->query->get('destination'); if ($destination && $destination != '/user/login') { return; }
- Assigned to prempatel2447
- Status changed to Fixed
10 months ago 11:41am 23 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.