I'm trying to build verification of email address for users, to verify their email is real. What package should I use to confirm the email address of the user? So far Im using mongoose and express
Code Example
var UserSchema = new mongoose.Schema({ email: { type: String, unique: true, lowercase: true } password: String }); var User = mongoose.model('User', UserSchema); app.post('/signup', function(req, res, next) { // Create a new User var user = new User(); user.email = req.body.email; user.password = req.body.password; user.save(); });
In the app.post codes, how do i confirm the email address of the user?
How to verify your email address. Click the “send it again” link to send verification email. If you need to change your email address, you can do so on the email edit page.
What you're looking for is called "account verification" or "email verification". There are plenty of Node modules that can perform this, but the principle goes like this:
active
attribute that is false
by defaultactive
will be false
initially)active
property to true
Your user is now verified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With