Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49186

Do not show login page if user is already logged in

$
0
0

@borN_free wrote:

My app have states that require authentication. When user is logged in and opens an application - I want to skip default 'login' page and want to transition to the 'user home' page.

So in .run() function I have the following code:

if (AuthService.isLoggedIn()) {
  $ionicHistory.nextViewOptions({disableBack: true});
  $state.go('app.home');
}

....
my states
....
$urlRouterProvider.otherwise('/public/login');

It works perfectly in browser, but when I use app on Android than I see login page for about an 500ms and then it is redirected to the home page.

How to fix this?
Thank you.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>