# Best practice for supporting both DB and Passwordless connections in React

**URL:** <https://community.auth0.com/t/best-practice-for-supporting-both-db-and-passwordless-connections-in-react/106431>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, auth0-react\
**Created:** [May 8, 2023, 7:31pm UTC](https://community.auth0.com/t/best-practice-for-supporting-both-db-and-passwordless-connections-in-react/106431 "2023-05-08T19:31:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnowacek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cnowacek/32/45490_2.png) [@cnowacek](https://community.auth0.com/u/cnowacek)\
**Post date:** [May 8, 2023, 7:31pm UTC](https://community.auth0.com/t/best-practice-for-supporting-both-db-and-passwordless-connections-in-react/106431/1 "2023-05-08T19:31:11Z")

</div>

Hello! I’m integrating auth0-react in our application and everything is working great with the DB connection. I’m trying to also support Passwordless logins/signups with SMS and am running into some trouble.

I’m wrapping the App in a Auth0Provider as the quickstart suggested. I have everything configured properly within the Auth0 console for Passwordless SMS authentication. However, I’m not able to see the option to authenticate with a phone number _unless_ I specify `connection: "sms"` in the Auth0Provider declaration within main.tsx. If I do configure the provider with this option then I’m able to auth with SMS _but_ then I’m no longer to auth with email. I have two separate buttons on our landing page page (e.g. “Continue with Email” and “Continue with Phone Number”), but I can’t figure out how to pass the connection option into the react-auth0 login method or modify the provider based on which button is selected 😕 .

My question is: What is the recommended implementation for supporting the option to auth with passwordless SMS _or_ email? Thank you for your help.

---

<div class="post-metadata">

**Author:** ![cnowacek](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/cnowacek/32/45490_2.png) [@cnowacek](https://community.auth0.com/u/cnowacek)\
**Post date:** [May 9, 2023, 4:01pm UTC](https://community.auth0.com/t/best-practice-for-supporting-both-db-and-passwordless-connections-in-react/106431/2 "2023-05-09T16:01:26Z")

</div>

I was able to solve this myself. For anyone else who comes across this, I was able to pass `authorizationParams`, that specified the connection, to the `loginWithRedirect(...)` function. It looks like this:

```auto
loginWithRedirect({authorizationParams: { connection: "sms" }})

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [May 23, 2023, 4:01pm UTC](https://community.auth0.com/t/best-practice-for-supporting-both-db-and-passwordless-connections-in-react/106431/3 "2023-05-23T16:01:32Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
