Hello,

on my page users will be redirect to an internal dashboard after they logged in. However, so far I can't make a differentiation wether they are using the normal login form, or the one time login they receive after an account was created or they want to reset their password.

I tried several ways of achieving this. Trigger and action doesn't provide me with differentiation. I also tried the modules Login Redirect (same problem) and LoginToboggan (doesn't seem to have that, too, and redirect doesn't even work). I read that this could be done via Rules, but I can't figure out how.

I could really use some help here. Does anyone know how to do this?

Comments

ahillio’s picture

Create new rule:

  • Event = user has logged in
  • Condition = Data > Text Comparison
    • Text Data Selector = site:current-page:path
    • Matching Text = reset
    • Comparison Operator = contains
    • Check the 'negate' box
  • Action = System > Page redirect
RaenFox’s picture

Am I using the wrong rules module? I can only add context, relation and criteria. None of those have login in the list. I also can't set an action here.

ahillio’s picture

"context, relation and criteria" ...I don't know what you're looking at or what that is. Use https://www.drupal.org/project/rules. Enable its sub-module called Rules UI (rules_admin) to access its admin interface. A rule has three parts, the event, conditions, and actions. Creating the rule as I outlined should be straightforward. But if you need more help just ask ...and provide more info[helps us help you].... :)

RaenFox’s picture

I clicked on rules links in the content section. Obviously the wrong ones.
I found where I need to go and followed your instructions. It works perfectly now.
Thank you.

trotsak’s picture

Thank you very much!

dmkelner’s picture

Does anyone know the equivalent recipe for D8?

ushma’s picture

Were you able to perform this task on D8 ?