【问题标题】:Reset password link not working in drupal 8重置密码链接在 drupal 8 中不起作用
【发布时间】:2018-07-03 06:04:18
【问题描述】:

我收到“http://example.com/user/reset/32/1530596529/g72Z2YhSpS8L5rWDXYKNCNoU1TRKF4GDGtnn2ictl0A

当我点击它时,“它会转换为http://example.com/user/reset/32/”,然后我会收到一条消息说“此登录只能使用一次。”

我想在电子邮件中发送直接哈希链接。

我没有使用重置链接,但它说。

“您尝试使用已使用或不再有效的一次性登录链接。请使用下面的表格申请一个新链接。”

任何帮助都会很棒。

【问题讨论】:

    标签: drupal-8


    【解决方案1】:

    你可能已经使用类似的东西生成了一个链接

        $account = \Drupal::entityTypeManager()->getStorage('user')->load(32);
        $link = user_pass_reset_url($account);
    

    你所说的似乎是一种正常的行为,因为,是的,当你点击一个链接时:

    1. 将您重定向到一个页面,该页面显示“此登录只能使用一次。” 底部有一个 登录 按钮。 enter image description here
    2. 单击按钮后,用户会被重定向到 user/edit 页面,鼓励他们更改密码。但此时用户已经登录。在这里不需要更改密码 enter image description here

    或者,您可能想要运行

        drush -vy uli --name="John.Doe" /user
    

    这将为您生成一个立即登录的链接。您可以在登录后指定用户重定向的路径。在此处查看详细信息 - https://drushcommands.com/drush-9x/user/user:login/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-11-04
      • 2011-12-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-28
      • 1970-01-01
      相关资源
      最近更新 更多