Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Setting URL for new user email confirmation/reset password #6297


User avatar
0
smackofham created

We are using the ASP.NET Core & Angular version of the project.

We modified the Web.Host appsettings.Production.json ClientRootAddress to point to the web server url instead of the default localhost:4200. However. whenever a new user clicks on the confirmation email link, we receive the following message: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

So, let's say our server is at https://www.random.com, the link we get is https://www.random.com/account/confirm-email?c=yaddayaddayadda

What are we doing wrong here?


6 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    What is the content of your appsettings.Production.json file?

  • User Avatar
    0
    smackofham created
    {
      "ConnectionStrings": {
        "Default": "<RemovedConnectionString>"
      },
      "App": {
        "ServerRootAddress": "http://localhost:9901/",
        "ClientRootAddress": "#{appBaseUrl}#",
        "CorsOrigins": "http://localhost:9902"
      }
    }
    

    We are replacing the #{appBaseUrl}# token during deployment. That changes to the web app url.

  • User Avatar
    0
    smackofham created

    OK - so what I've found is that our routing seems odd. The URL is in this format: https://www.random.com/#/account/login

    The email activation url is: https://www.random.com/account/confirm-email

    If i add the /#/ to the second URL, everything works. Where is this coming from, and why? We have made no modifications to the routing.

  • User Avatar
    0
    ryancyq created
    Support Team

    you need to look at your angular settings (appconfig.production.json)

  • User Avatar
    0
    smackofham created

    I have, and as far as I can tell, it looks fine:

    {
      "remoteServiceBaseUrl": "https://not-real-uri-api.azurewebsites.net",
      "appBaseUrl": "https://not-real-uri.azurewebsites.net",
      "localeMappings": [
        {
          "from": "pt-BR",
          "to": "pt"
        },
        {
          "from": "zh-CN",
          "to": "zh"
        },
        {
          "from": "he-IL",
          "to": "he"
        }
      ]
    }
    
  • User Avatar
    0
    smackofham created

    OK - found the issue - for whatever reason a developer added {useHash:true} to the root-routing.module.ts. At this point I have no idea why, but, there it is.

    Thank you.