html5 - AngularJS SPA What's the best way to make a login service with a large app? -


i working on project 100+ pages , using angularjs ui-route , php rest backend. authentification want use json web token.

i trying find best way make login page, didn't found way still, after lot of googling.

my app allows logged in users access it, else should go login page.

my main problem how should organize index.html because login page has totally other template rest of app.

in index.html have lot of elements header , footer loaded on pages, except on login page. in order achieve used ng-if={{user.isloggedin}}, it's not right thing do, think, because 1 page must have condition on pages.

another idea use 2 apps, if user not logged in redirected login app (actually redirection, not change of state, because uses master template).

is there way in keep login page in spa, have 1 app?

thanks in advance valid answer , hope i've been clear possible.

look nested views ui-route. able have $state.login , $state.dashboard state while logged in follow $state.dashboard.home etc. if want keep in 1 app may easiest solution you. https://github.com/angular-ui/ui-router


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -