Hi to all! Thank you for you perfect solution whic...
# support-questions-legacy
m
Hi to all! Thank you for you perfect solution which I'd like to use on my project! I'm implementing "email password + social login" receipt with self-hosted installation. I've successfully setup db, supertokens-core, backend and frontend middleware with login with google, email deduplication, smtp transport and etc. My problem that I do not receive email with verification link after user signed up. Meanwhile restore password function works well. I'm using "required" mode for email verification. Could please somebody help me with that?
r
hey @mikeharrier did you call the email verification API from the frontend? The email is not sent on its own post sign up. The API needs to be called (in our pre build UI, the API is called on its own)
m
I also configured frontend for email verification but in "OPTIONAL" mode - may it be the issue? In my backend I covered with "verifySession" only user-related methods, so the idea was that customers may use public part of the website and after login they should see new sections with warning ("please confirm your email"), but can't call some specific methods which require email verification.
*and yes I use your pre build UI
r
right. In this case, you should change the mode on the backend to OPTIONAL as well
and then you can use the email verification claim validator in your APIs / routes in which you requires the user's email as verified to access them
m
I did it so, but emails also not sent to customer email
r
you would need to call the API from the frontend to send the email
m
Ok, but how?
r
Or rather use the email verification claim validator on the frontend
in routes which require an email verification
m
Or you mean just any API method/
r
that will redirect the user to the email verificaiton screen which will call the API
if you want to manually call the API, you can use the
sendVerificationEmail
from our frontend SDK
Copy code
import { sendVerificationEmail } from "supertokens-auth-react/recipe/emailverification";
m
Thanks! Will do the tests!
r
or you can just redirect the user to the email verification page when you want to send an email verification email to them. Our pre built UI compenent will send an email to them on its own
m
@rp_st Could you please show how to redirect user to email verification page?
I think this is would be the best way
r
use the router of your app to navigate to the email verification path - that's all
m
But what is "email verification path"?
r
by default it's
/auth/verify-email
m
Great! Thank you!
@rp_st everything works perfect now and as expected! BTW I achieved most suitable behaviour with mixing email verification "Required" mode on backend and "Optional" mode on frontend and its works fine!
r
Hmm. I see. Im curious - what's this behaviour?
m
I have part of public backend methods which are do not covered with supertokens and a bunch of methods which required authorization and email verification, so for me more comfortable to disable for these methods access by default. Same time user may see after registration and before email verification a new sections with warning "Please verify your email" which view partially based on public data. If user try to apply his own settings before his email become verified he got warning "Please verify email to use this function" - kind like that
So in short "pages" might be accessible but "action methods" on it no
r
i see. But even
GET
APIs that do session verification on the backend will require a verified email cause backend has mode REQUIRED - is that expected for your use case?
m
Yes, I'll send you the demo when it will be ready to show, I think the point is that I'm implementing this integration in old project with big codebase
r
i see. Fair enough. Thanks