Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70440

Auth Guards with observables for 2 routes not working when i use route.navigate

$
0
0

@jesuscardenas wrote:

Hi Guys, I hope you’re doing very well.

I’m here 'cause I have been coding an app with Ionic 5
Angular CLI: 8.3.25
Node: 12.16.1
OS: win32 x64
Angular: 8.2.14

But i have added 2 route guards to 2 routes which should redirect to a different route when the user is not logged in, however it’s not working since when the auth guard it’s called, the app renders nothing, the screen become blank. When i delete the canActivate property from 1 route, the other one works perfectly. I dont know what can i do, i have been stuck in this issue for a long time.

I’m working with aws amplify for the auth system. I attached my github repo for you reference. Please work with the branch dev.

swapp\src\app\app-routing.module.ts in this file i have the routes.
swapp\src\app\auth.guard.ts this is one auth guard
swapp\src\app\auth1.guard.ts this is the other one

i have 2 routes
http://localhost:8100/home working well
http://localhost:8100/auth not workin

user for login: jacc_2008@hotmail.com
password: Asdf123*

Please help guys! thanks in advance.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70440

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>