Hey there! is there a way to customize the email v...
# support-questions-legacy
y
Hey there! is there a way to customize the email verification form? the same way we can customize signup/signin form
r
hey! Yea there is.
which recipe are you using?
y
3party+email
r
So there are a few ways:
Via react component override:
Copy code
ts
ThirdPartyEmailPassword.init({
    override: {
        emailVerification: {
            components: {
                EmailVerificationSendVerifyEmail_Override: ({ DefaultComponent, ...props }) => {
                    // this is the screen which shows that an email verification email has been sent
                    return <DefaultComponent {...props}/>
                },
                EmailVerificationVerifyEmailLinkClicked_Override: ({ DefaultComponent, ...props }) => {
                    // this is the screen which is shown when the user clicks on the email
                    // verification link
                    return <DefaultComponent {...props}/>
                },
            }
        }
    }
})
Method 2) You can disable the default UI and make your own:
Copy code
ts
ThirdPartyEmailPassword.init({
    emailVerificationFeature: {
        disableDefaultUI: true
    }
})
Method 3) Change style / CSS:
Copy code
ts
ThirdPartyEmailPassword.init({
    emailVerificationFeature: {
        sendVerifyEmailScreen: {
            style: {...}
        },
        verifyEmailLinkClickedScreen: {
            style: {...}
        }
    }
})
y
in the method 2, what API calls we need to make on the backend?
r
Copy code
ts
ThirdPartyEmailPassword.isEmailVerified() -> to check if an email is verified or not

ThirdPartyEmailPassword.sendVerificationEmail() -> send a verification email (uses the current session of the user on the backend to get the email)

ThirdPartyEmailPassword.verifyEmail() -> to call on the page which opens when the user clicks the email link
y
that's very useful, but can you explain a bit more the last method?
r
Sure. So it will take the email verification token from the URL's query param and call the backend API which will consume it and mark the email as verified
Also, in the callback page, make sure to check if a session exists, if not, you should ask the user to click on a button or something before calling that function cause otherwise it has the risk that some email clients would verify the email by auto opening the links.
y
ah so the /auth/verify-email route will be disabled in method 2 so I need to check the token and verify right?
yeah makes sense about the auto-opening
thanks for the details @rp_st
r
> ah so the /auth/verify-email route will be disabled in method 2 so I need to check the token and verify right? Yes.
I mean, you don't need to check the token yourself.. just call that function and it will do it's thing
but yea.. if calling that function is what you meant, then you are right
y
yes yes got it, the function will check the param and notify the backend
r
yes
y
👍
thanks again
r
Happy to help 🙂
5 Views