Answer the question
In order to leave comments, you need to log in
How to check if a user is logged in in Angular?
Good afternoon!
How to check if the user is logged in at the start of the client code in Angular?
Authorization occurs through express-session, and simply stores the session id in cookies, i.e. to find out if the user is logged in, you need to make a request to the back API. How to make this request before running Angular?
PS Set the login status in ng-init and in general in html at the time of the request, I think it's a crutch
Answer the question
In order to leave comments, you need to log in
PS Set the login status in ng-init and in general in html at the time of the request, I think it's a crutch
angular
.module('app', [])
.run(runapp);
runapp.$inject = ['$scope'];
function runapp(){
// place your code here
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question