I want users to login in my application before they verify their email, maybe only allow them to do certain actions before they verify it.
Also how can I know a user is not verified so i can send another verification email.
It's any way in payload to do this?
email verification is optional if you did not set
verify: trueon your user collection config. When enabled, though, it adds a
_verifiedfield to your user that you can use for any purpose.
Hey
@710199181305839707did you find a solution to allowing users to login before they verify their email? I'm trying to achieve the same outcome but can't find a solution.
tnx!
How can we set up Payload's email verification so it's not required to sign in, but needed for later actions? For example, a user signs up, gets a verification email, is logged in automatically, but must verify their email to do certain things later. How do we do this?
tnx
i added a custom token for email authentication, a custom verified property and a hook for every request
basically when you create a new user, you create an uuid or something like that
then you send the email and create an endpoint that find the user with that uuid and add a "verified" property to the document
It's good practice to have users verify their emails, but of coursethere are varying situations
But from a security point of view, it's a better path
and then in a prehook (i dont remenber the name in payload) you block the request if the resource enforces email verification or if the time window is short, like the first hour of an registered user
yeah definitely, but sometimes you want to allow users to have some interactivity at the time when the account is created
like you have some time to verify your email meanwhile you can access some content
is a ux practice that is valid for some services
Exactly, thank you
@710199181305839707Star
Discord
online
Get dedicated engineering support directly from the Payload team.