I am writing an ionic application from scratch. I built a login page and was able to successfully authenticate at the server. After authenticate i am routing to a page called "tabs" when i do this the url changes but the page still just shows the login screen. I am sure im missing something obvious but cant seem to figure it out.
this is the method
async login() {
const loading = await this.loadingController.create();
await loading.present();
this.authService.login(this.credentials?.value).subscribe(
async (res) => {
await loading.dismiss();
await this.router.navigate(['/tabs'],{ replaceUrl: true });
},
async (res) => {
await loading.dismiss();
const alert = await this.alertController.create({
header: 'Login failed',
message: res.error.error,
buttons: ['OK']
});
await alert.present();
}
);
}
the url at the top will say http://localhost:8100/tabs
but the page being displayed is still the login page