Currently, users can access all pages even though they are not logged in, so need to prevent user from accessing to detail pages (all pages except login and register page).
Acceptance cretirea
If your access to any page not allowed to access via enter Url or slide menu, prevent them or redirect to login page.
Guide :
After logging in successfully, i currentUser key will be save to localStorage, please use it to check login status
Or you can also use currentUserValue function of AuthService to check it.
Currently, users can access all pages even though they are not logged in, so need to prevent user from accessing to detail pages (all pages except login and register page).
Acceptance cretirea
Guide :
After logging in successfully, i currentUser key will be save to localStorage, please use it to check login status Or you can also use currentUserValue function of AuthService to check it.
Using Angular guard to implement it .
Ref : https://viblo.asia/p/bao-ve-routes-su-dung-guards-trong-angular-3Q75wWX35Wb https://angular.io/api/router/CanActivate https://www.youtube.com/watch?v=tSfvCfVoW2M