4
Is it possible to authenticate with Angular and recover the logged in user? If possible what best practice to do?
4
Is it possible to authenticate with Angular and recover the logged in user? If possible what best practice to do?
3
I didn’t 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 server-side authentication is positive, I return a user object with the information that is required to save to the WEB. to save this information on the web, I use Sessionstorage, I could also save in Localstorage, this goes of your need.
Follow example below p/ include the same in sessionStorage.
$http.post('url', objeto).then(function(retornoSucesso) {
sessionStorage.setItem('userLogado', retornoSucesso.data) //objeto de usuário que utilizo.
});
Browser other questions tagged angularjs
You are not signed in. Login or sign up in order to post.
A question, how to recover the logged in user(Object) from session?
– DiegoAugusto
sessionStorage.getItem('userLogado') @Techies
– Renan Degrandi