Yes you can, you have to override the signin and signup (whatever their name are according to your recipe), query your table and build the logic. (Of course in your backend)
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).