Forgot_Password Page

Answered
0
0

Hey guys!

I’m creating a “forgot_password” Wisej page keeping the same concept as the most of the sites use (Click on the link, redirect to a page to password reset). As WiseJ is based on the Single Page Application concept (SPA) and needs only one Main Method which acts as entry point for the program.cs, I’ve created another main method for the forgot_password page so that when the user opens the page, it opens without depending the first main method which points to the login page. To make this work, I also created another html page and json file using the same logic as the default.html page. I do this practice because it came up on my mind when user receives an automatic email with the link provided to reset their password.

My question is if this is OK  to do it or exists another better way??

Thanks in advanced,

Carlos

  • You must to post comments
Great Answer
0
0

Hi Paul! Thanks for replying.

The deep linking works well when you want to navigate and pass parameters between Wisej pages in the application. What if you click on a link, and that link has to open any page other than the main page of the app? How can you get that possible? That is what I want to accomplish with the forgot_password page.

Thanks,

C

  • Luca (ITG)
    Check Application.Hash in your Program.Main and create the appropriate page.
  • Carlos Lino
    Ahhh You got it! I will post the snippet code in case this helps to someone else. static void Main() { if (Application.Hash == “forgot_password”) { test1 window = new test1(); window.Show(); } else { frmlogin window = new frmlogin(); window.Show(); } } It works fine, but If you have multiples pages, it’s better to have a switch control structure instead. Thank you, Luca and Paul
  • You must to post comments
Great Answer
0
0

Hi Carlos

Your aproach is create a sub-application, that create a new session.
For you case descibed, is better use aproach of deep linking and the Application.Hash and HashChanged

Here you can found info about deep linking
https://developer.mozilla.org/en-US/docs/Web/API/Window/hashchange_event

And sample in Wisej here
https://github.com/iceteagroup/wisej-examples/tree/2.2/DeepLinking
Hope to be helpful
Regards

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.