Is it possible to authenticate with Angular and recover the logged in user? If possible what is the best practice to do?
Is it possible to authenticate with Angular and recover the logged in user? If possible what is the best practice to do?
I did not quite understand your question, but I will apply an answer that I use.
I authenticate a user with the server, using the http service, and if the server side authentication is positive, I return a user object with the information that is necessary to save on the WEB. to save this information on the WEB, I use the SessionStorage, could also save in LocalStorage, this goes beyond your need.
Follow the example below to include the same in sessionStorage.
$http.post('url', objeto).then(function(retornoSucesso) {
sessionStorage.setItem('userLogado', retornoSucesso.data) //objeto de usuário que utilizo.
});