Differentiate Sign in and Sign up for passwordless sms


I am trying to see if there is a way we can differentiate login and sign-up flow for passwordless SMS. I found a way to restrict a phone number if that exists in our system by using pre-user registration. However, when clients want to link both email/password and passwordless, is there a way to know that the client is trying to link the account so bypass the check from the pre-user-registration? our client will prompt the user a dialogue box after signing for initiating to passwordless SMS.