This site is amazing and I am learning something new everyday!
I had one question (I am using Nodejs and Express):
Suppose I have 2 links. Each of these links leads to a unique form:
Link A --> (login form if not logged in) --> Form A
Link B --> (login form if not logged in) --> Form B
Upon clicking on these links, if the user is not logged in, I would like to redirect the user to the login page. Upon logging in, I would like the user to go to the correct page.
Is there a nice concise way to implement this? I had the following solution in mind:
Upon clicking on the link, redirect to a unique login page for each of the two links, which in turn redirects to the correct form page upon loggin in.
For example, clicking on Link A triggers a get request to “/login form/form A”. This then upon loggin redirects through a get request to “/form A”
This seems a bit long winded and repetitive.
Any guidance is much appreciated!