React Native App: Email Address Verification Firebase

Viewed 26

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 "johndoe@genius.com". How can I do this?

1 Answers

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

Related