camilosampedro / Aton

Open web computer laboratory administrator
http://camilosampedro.github.io/Aton
GNU General Public License v3.0
14 stars 12 forks source link

Get the cookie auth from the response #55

Open camilosampedro opened 7 years ago

camilosampedro commented 7 years ago

Inside login.service.ts, after a correct login, check the existence of PLAY2AUTH cookie.

Actually it is getting the cookie and it is sending it to the server automatically as a default browser behavior, but the Angular2 code doesn't correctly know that it is logged in, it is only being checked that the response is a 200 and saving a token with localStorage.

hristo-tanev commented 7 years ago

Hey, I'd like to work on this issue :), but it is one of my very first times contributing, so I might need some help :)

camilosampedro commented 7 years ago

Thank you and you are very welcome to contribute!

One of the first steps is understanding how the authentication process is done for this particular application: It is used a token sent inside a cookie between server and client.

The main problem is that I could not understand why Angular2 is not aware of the existence of that cookie, even if it exists at run time. It is important because it is the main way to know it the user is logged in or not, to change its view.

As you are new to the project, it would be very great if you have some suggestions or advices. 😄

Feel free to ask anything you want, good day.

hristo-tanev commented 7 years ago

Thanks, will look into it and of course ask if anything is unclear :)