David Guri
David Guri

Reputation: 111

React Native App: Email Address Verification Firebase

I have a React Native app running on Firebase and I wanted to make it so that when you sign up you can only use a certain custom domain email like for example "[email protected]". How can I do this?

Upvotes: 1

Views: 74

Answers (1)

Gaurav Roy
Gaurav Roy

Reputation: 12215

You can do frontend regex like

const emailRegex = /^[\w-\._\+%]+@(customDomain|customDomain1)\./

and before submitting that email in api call, you can test this

const onSubmitAPi = (text) => {

if(!(emailRegex.test(text))){
return null
}

//call api here

}

Hope it helps, feel free for doubts

Upvotes: 1

Related Questions