Closed kant01ne closed 3 years ago
import { EmailVerification, EmailVerificationBannerTheme } from "supertokens-auth-react/recipe/emailpassword"
<EmailVerification>
<EmailVerificationBannerTheme />
<EmailVerification>
We can update the banner (update its color and text) to "We have sent you an email" if successful. Hence, making it harder to send it multiple times (would need a page refresh) which I think is fine.
TODO Later
supertokens-node
version with email verification featuresEmailPasswordAuth
component https://github.com/supertokens/main-website/pull/190auth-react
v0.4 docs with emailVerificationFeature configs.supertokens-react-themes
changes and prepare upgrade to 0.4.0
supertokens-react-themes
This comment will be ignored in favour of https://github.com/supertokens/supertokens-core/issues/157
As raised in #110, we need a way to know the login URL in EmailPasswordAuth
in case it gets overwritten, and would need yet another props
for this. Not going to fix now with a new props as we are discussing https://github.com/supertokens/supertokens-auth-react/issues/117 tmrw.
EmailPassword Recipe: Email verification
Sub issue of https://github.com/supertokens/supertokens-core/issues/124
isEmailVerified
type isEmailVerified = () => Promise<boolean>
import { isEmailVerified } from "supertokens-auth-react/recipe/emailpassword"
isEmailVerified will use an API for now. Later on, we can make it use sessions instead (as a caching layer). Page loading time problem (in required mode) is solved by setting the default to email being verified and then querying to check if it has been. This makes sense since most of the time, in required mode, the is verified will be true.
If the user visits the {websiteBasePath}/verify-email?rid=emailpassword and the email is already verified, then they will be redirected to the success callback.
Configs
Default URLs
For required mode email verify UI: {websiteBasePath}/verify-email?rid=emailpassword For email clicked UI: {websiteBasePath}/verify-email?rid=emailpassword&token=TOKEN
Email verification (Required mode)
Auth Component
onCallEmailVerifiedAPI
: By default, use new FDI specsdoesSessionExist
: By default, use session recipeonHandleShowEmailVerificationScreen
:{websiteBasePath}
1.2/ Yes, continue{websiteBasePath}/verify-email?rid=emailpassword
2.2/ Yes, continue toonSuccessRedirectUrl
EmailVerificationScreen
{websiteBasePath}/verify-email?rid=emailpassword
=> Automatically added by EmailPassword feature{websiteBasePath}/verify-email?rid=emailpassword&token=TOKEN
=> Make a call to corresponding API to verify email.onCallVerifyEmailAPI
: By default, use new FDI specs.onCallSendVerifyEmailAPI
By default use new FDI Specs.signOut
: By default, use signOut method from EmailPassword recipe.EmailVerification Themes