Authentication with AngularJS
Matthew Lanham
1108

Nice article and want to implement it, but can you please explain !AuthService.isAuthenticated()? Why not … && (AuthService.isAuthenticated == false)

I assume isAuthenticated method will return true for logged in user and false for unauthenticated user.

so if the state authenticate property is true and user is logged in.

The above script looks like this

if((toState.authenticate == true) && (NOT true))
 //go to login

so vice versa if user is unauthenticated? will go to login?

Sorry my question is just !AuthService.isAuthenticated() logic, btw I’m new.

Thanks in advance.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.