• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Checking for user.roles if it is equal to a specific role and based on that determine the URL Forgot-Password

Scheduled Pinned Locked Moved Unsolved
General Discussion
2
2
542
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E
    essamkayall1996
    last edited by 2 May 2024, 02:24

    I have a case where I have two websites for the same Fusionauth application

    So I am trying to differentiate the Reset-Password URL based on the role

    how can I achieve such a case in the template.

    I have tried this

    [#if user.roles?? && "client" in user.roles]
    <a href="https://test.com/${changePasswordId}">
          Reset Password
        </a>
    [#else]
    <a href="https://test.com/${changePasswordId}">
          Reset Password
        </a>
    [/#if]
    

    and it refuses to render.

    Any help here !

    M 1 Reply Last reply 3 May 2024, 14:25 Reply Quote 0
    • M
      mark.robustelli @essamkayall1996
      last edited by 3 May 2024, 14:25

      @essamkayall1996 Are you able to debug and confirm "client' is in the list of user.roles? Also are you saying that no page renders? What error message are you getting? It looks like in either case of if statement that you are returning the same page.

      1 Reply Last reply Reply Quote 0
      2 out of 2
      • First post
        2/2
        Last post