ronzeidman/ng2-ui-auth-example

All runs well, can auth with local and google but server responds with Unauthorized

Closed this issue · 5 comments

Page displays


Unauthorized

console displays 

Failed to load resource: the server responded with a status of 401 (Unauthorized)

Everything runs fine, can auth to google for instance, but for some reason this is happening. Have confirmed data is saving successfully in rethinkdb also.

All modules installed correctly on npm install. So really cant see any reason why this is failing,.

If I restart the project, I can sign in, and my name appears, but I still get 401 unauthorized trying to access the helloworld route.

I log out, log back in, my name no longer appears, but still I get 401 unauthorized.

Did I miss something in the setup?

cheers

No, this is the expected behavior. The upper section uses the JwtHttp and the lower "unauthorized" uses plain Http, this is to show that the server blocks unauthorized communication and doesn't block authorized ones.
Maybe I should explain it in the read me

Fixed the issue of 'Hello undefined' this was caused due to the return of an array instead of a single user by the DB query of "google" route. it was fixed in the latest commit.

Thanks very much Ron. I gotta say this is a really great thing you have done porting satellizer from angular 1 to 2. Looking through your code you have done such a sweet job.

Thank you so much for your hard work, and I love that you are using rethinkdb for storage.

Thanks :)

I've updated the readme to show the expected result.

Cheers Ron