Login And Logout Redirect Per Role settings page
Login And Logout Redirect Per Role menu item

ABOUT:

Module provides ability:

  • Redirect user (to specific URL) on Log in
  • Redirect user (to specific URL) on Log out
  • Set specific redirect URL for each role
  • Set roles redirect priority
  • Use Tokens in Redirect URL value
  • CAS integration

Roles order in list (configuration form) is their redirect priorities: higher in list - higher priority.

Live demo: https://youtu.be/dzLwguiJdYQ

Working logic:

For example, you set roles ordering as:

+ Admin
+ Manager
+ Authenticated

It means: when some user log in (in case of "Login redirect" table, configuration form) or log out (in case of "Logout redirect" table, configuration form) module will check:

Does this user have Admin role?

  • Yes and Redirect URL is not empty: Redirect to related URL
  • No or Redirect URL is empty:

Does this user have Manager role?

  • Yes and Redirect URL is not empty: Redirect to related URL
  • No or Redirect URL is empty:

Does this user have Authenticated role?

  • Yes and Redirect URL is not empty: Redirect to related URL
  • No or Redirect URL is empty: Use default Drupal action

INSTALLATION:

  1. Install the module to modules/contrib or modules folder
  2. Enable Login And Logout Redirect Per Role module

CONFIGURATION:

  1. In menu go to: Configuration -> System -> Login and Logout Redirect per role
    (or /admin/people/login-and-logout-redirect-per-role)
  2. Set 'Login redirect' table "Redirect URL" values and roles priority (order in table)
    to setup redirect user on Log in action.
    Or leave "Redirect URL" values empty if you don't need redirect on user Log in.
  3. Set 'Logout redirect' table "Redirect URL" values and roles priority (order in table)
    to setup redirect user on Log out action.
    Or leave "Redirect URL" values empty if you don't need redirect on user Log out.
  4. Click "Save configuration" button.

SIMILAR MODULES:

Drupal 8:

  • Redirect after login provides simple redirect to certain page for any user after login.
  • Login Destination it's a great complex solution which provides ability to redirect user on: Login, Logout, Registration, One time login by link to different pages depending from: User role or Current site language.

Comparison with similar modules

Login And Logout Redirect Per Role provides the middle solution (between these 2 modules). It's:

  • Lightweight as Redirect after login
  • Provides ability to set different destination pages after Login and Logout for users with different roles as Login Destination
  • Provides unique functionality: Ability to set per role redirect priority (see "Working logic" section)
Supporting organizations: 

Project information

Releases