How do I get the current URL in a rule? I am trying to make a Rule where after the user logs in they are redirected to the front page except when they are setting their first time password or resetting their password
To do it I want to use a Rule that acts on User Logged In, with a condition that checks if the url they are on has edit in the name, and if it doesn't then redirect them to the front page.
My issue is that when I try to use the Path Contains Text condition it never triggers, and if I try to print the url in a message as the action it is always empty.
What am I doing wrong? What do I need to do to get the results I want?
Here is a working example taken from the Rules Examples module, which is a submodule of D8 Rules Essentials.
langcode: en
status: false
dependencies:
  module:
    - tr_rulez
  enforced:
    module:
      - tr_rulez
id: redirect_to_home
label: 'Redirect to home on Login'
events:
  -
    event_name: rules_user_login
description: 'Issue #2975452-6: Redirect all users to &quot;/&quot; on login, except for when a one-time login password is used.'
tags:
  - login
  - redirect
  - rules_examples
config_version: '3'
expression:
  id: rules_rule
  uuid: 7263942c-3847-460d-af3f-6c78f80fbcc1
  conditions:
    id: rules_and
    uuid: a8c1bb95-b783-4238-a7e1-9b4b9fb96ca4
    conditions:
      -
        id: rules_condition
        uuid: f35e2d95-850d-455d-99e2-629e37b17cb7
        context_values:
          text: reset
        context_mapping: {  }
        context_processors:
          text:
            rules_tokens: {  }
        provides_mapping: {  }
        condition_id: rules_path_contains_text
        negate: true
  actions:
    id: rules_action_set
    uuid: d17285ef-4de4-498a-8b78-654cf79566ee
    actions:
      -
        id: rules_action
        uuid: a529b090-e6f3-4421-aede-75489267d888
        context_values:
          url: /
        context_mapping: {  }
        context_processors:
          url:
            rules_tokens: {  }
        provides_mapping: {  }
        action_id: rules_page_redirect