ionic-framework: RC-0: navigation failed to blank page
Short description of the problem:
navCtrl.push(...) after a login attempt works only with Chrome developer tools (android device).
Otherwise, it goes to the redirect page, and quickly shows a blank page instead.
It’s the same behavior with setRoot
UPDATE In a more simple scenery, with no redirect before login, still leads to blank page. https://github.com/ecureuill/Ionic2RC-Auth0.git3
So I guess it is not a bug specific to method push() or setRoot.
Could be a problem between ionic navigation and angular navigation?
UPDATE
What behavior are you expecting?
Steps to reproduce:
- ionic serve
- open Chrome developers tool (android device)
- navigate (works)
- ionic serve
- navigate (don’t work)
import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { AuthService } from '../../providers/auth0'
import { HomePage } from '../home/home';
@Component({
selector: 'page-login',
templateUrl: 'login.html'
})
export class LoginPage {
constructor(public navCtrl: NavController, private auth: AuthService) {
this.redirectTo();
}
public get autenticado(): boolean {
return this.auth.authenticated();
}
login() {
this.auth.lock.show();
}
redirectTo() {
if (this.auth.authenticated()) {
this.navCtrl.push(HomePage);
} else {
this.auth.lock.on('authenticated', authResult => {
this.navCtrl.push(HomePage);
});
}
}
}
Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc) https://forum.ionicframework.com/t/page-coming-as-blank-after-login-in-ionic-2-rc0/65077
Which Ionic Version? 1.x or 2.x 2.0RC-0
Run ionic info from terminal/cmd prompt: (paste output below)
Your system information:
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie)
Node Version: v4.5.0
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 25 (3 by maintainers)
@jgw96 not really, my login page just posts to my own json api without using Auth0, I don’t use any plugin for this, my login process sends and receives everything through http post.
after a succesfull login i go to the login page using:
this.navCtrl.setRoot(ProfilePage);This worked in beta11 and 10.
Also other pages where i set the root the same way work fine, those are all fired by a click though, that is the only difference.
The problem is only on android devices, google chrome, and in the chrome developer tools if you set the device to an android device, ios devices in developer tools work fine.
Workaround there is a workaround though. Wrapping the setRoot in a timeout fixes the problem.
So this is not an Auth0 issue but a framework related issue.
Hello all! Since this seems to be an Auth0 related issue and not a framework issue I am going to close this issue for now. Thanks!
@ts1812 good finding. If you find workaround, please, inform here or at #8510
Hello all! I am going to close this issue as a duplicate of https://github.com/driftyco/ionic/issues/8510. Thanks!
@ecureuill
unfortunately that isnt the issue as i am calling setRoot from a function after receiving data from the json api. But thanks for your input!