I have mobile-auth setup with separated flows to register user with mobile phone and auth flow to provide authentication with code on mobile with my custom SPIs on java (as in Server Development guide from Keycloak).
I want to support the next script - when user enters mobile phone number and keycloak sends code to auth if user exists and registers user if not.
Is it possible to do in one step (in one authenticator) in keycloak? If yes - how can I switch to registration flow inside of browser auth flow?
Is it good practice or I missed some conceptual points?