ronzeidman / ng2-ui-auth-example

MIT License
34 stars 14 forks source link

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

Closed nigel-dewar closed 8 years ago

nigel-dewar commented 8 years ago

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
ronzeidman commented 8 years ago

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

ronzeidman commented 8 years ago

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.

nigel-dewar commented 8 years ago

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.

ronzeidman commented 8 years ago

Thanks :)

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

nigel-dewar commented 8 years ago

Cheers Ron