Notify of
Inline Feedbacks
View all comments

[…] 6. Ionic 5|4 Login & Registration Form using Guard Working UI … […]

[…] 7. Ionic 5|4 Login & Registration Form using Guard Working UI … […]


All great thanks!!!


The big issue with this approach (that is the same that i saw in many others tutorials, btw) is that authguard check BEFORE that autentication service even be created, so if you refresh the page the first thing you say is app root (whatever it is, in my case login page) and only AFTER will subscribe for changing in authState (that will be fired in constructor service itself). Basically, login page appears for 1 sec or so. And i don’t like it.


Thank you for nice article. This example working fine.

But, How I can handle hardware back button on login page after user logged in, both in sidebar and tabs page application. In device after login success tabs page comes than after press back button than login page show again 🙁

I tried to add a new authGaurd for login page, but blank page comes for few sec.

How can handle this? Please post a example.



Thank you. But there’s an error. Why is that? I did the same thing.
Error: StaticInjectorError(AppModule)[AuthGuardService -> AuthenticationService]:
StaticInjectorError(Platform: core)[AuthGuardService -> AuthenticationService]:
NullInjectorError: No provider for AuthenticationService!

Mary User

Thanks, nice simple explanation.
How would you handle different access Levels? e.g. in WordPress you have Admin, Authors etc.

Say I have Level 1, Level 2, Level 3 users how would I save, and use their access level using this technique?