If I do click on link to my application but I'm not authenticated then redirect me to login page, after login not follow the original route, the application redirect me to home page.
Expected behavior
After authenticate me, redirect to original route (original link).
Minimal reproduction of the problem with instructions
install a new project using ngX-Rocket CLIngx new.
start dev-server: npm start
open http://localhost:4200/about, the application redirect you to http://localhost:4200/login
login with any credentials
the application redirect you to http://localhost:4200/home and not to http://localhost:4200/about
I'm submitting a...
Current behavior
If I do click on link to my application but I'm not authenticated then redirect me to login page, after login not follow the original route, the application redirect me to home page.
Expected behavior
After authenticate me, redirect to original route (original link).
Minimal reproduction of the problem with instructions
ngx new
.npm start
http://localhost:4200/about
, the application redirect you tohttp://localhost:4200/login
http://localhost:4200/home
and not tohttp://localhost:4200/about
Environment
Others:
I want to contribute adding this feature. But please review my idea.
Explanation
On
authentication.guard.ts
save the url to be redirected. This would be saved onauthentication.service.ts
On
login.component.ts
inlogin()
functionThat's all. Thanks.