Back navigation from Login Page to App

Hello everyone,
i’m working on an Ionic app with Keycloakjs 9 and i’m facing a problem with back navigation from the login page back to my app. The the login function returns a promise error ‘An error happened during the login’, but this is the exact same error message as if there occurred a real error. Is there any way to decide, if it was a back navigation or an error? In case of an error I want to display a notification to the user, but in case of back navigation not.