Rank 2: Process
Hey everyone,
At the moment on my app, users can create an account with any email they wish without any type of verification. I want to implement a way to verify emails on account creation. My idea was to have it so that when a user registers an account, it will send them a "login email" with a link that logs them in to their account (which means the email is verified). It shouldn't let the user access the account if they've not used that link.
This is my current code for my login and register functions:
const handleUserLogin = async (e, credentials) => { e.preventDefault()
try { const response = await account.createEmailSession(credentials.email, credentials.password) const accountDetails = await account.get() setUser(accountDetails)
navigate('/') } catch(error) { console.warn(error) }}const handleUserRegister = async (credentials) => {
try { let response = await account.create( ID.unique(), credentials.email, credentials.password1, credentials.name ) await account.createEmailSession(credentials.email, credentials.password1) const accountDetails = await account.get() setUser(accountDetails) navigate('/') } catch(error) { console.warn(error) }}Does this functionality already exist within Appwrite?
Thank you in advance! 😄