Don't return to home page

Hi. I’m a beginner in Ionic! I create an application that contains an authentication page that allows users to access their accounts.
My issue is how to forbid a user to return to the authentication page after a successful access to his account, even if he clicks on the back button of his device, in order to avoid the test of several login and passwords and to receive the (local) notifications that would be loaded in the account home page.
Thank you in advance.

Simple, when you press the button ask if the User is logged in or not as example:


     console.log('user is logged in don't push');

Your code will differ from this one but thats basicly it you are just asking if the user is logged in or not by getting a promise back. (True or False in that case).

This is an impossible goal. Anybody with sufficient motivation and a copy of the app binary can quite easily spin up a robodialer to try various login attempts. Anything you want to try to do to prevent that needs to happen on the server. The app itself is irrelevant.

Thany you very much.

  • cherry, my app is connected with a mysql daba base not firebase, i never used it !
    can you tell me what can I change in your code to be compatible ?

  • rapropos, what do you mean by the app binary?
    this app will be putted in playstore and appstore, it’s possible to use a robodialer in this case !

The .ipa or .apk file.

Absolutely. As long as somebody knows the endpoint used for login, which can be gleaned from either examining the app file or spying on its network traffic, crafting a robodialer would be trivial.

I agree with @rapropos and just another way is to bypass login page by remembering or storing the user in local storage and add a condition to check if the user is already logged in then bypass the login page.
It’s just a way around not the exact solution of what you asked.