Explorar el Código

Update email verification to automatically log in the user after verification.

Lee Morgan hace 5 años
padre
commit
f3ca913054
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      controllers/emailVerification.js

+ 3 - 2
controllers/emailVerification.js

@@ -94,9 +94,10 @@ module.exports = {
                 return owner.save();
             })
             .then((owner)=>{
-                req.session.success = "EMAIL VERIFIED. PLEASE LOG IN";
+                req.session.owner = owner.session.sessionId;
+                req.session.merchant = owner.merchants[0].toString();
 
-                return res.redirect("/login");
+                return res.redirect("/dashboard");
             })
             .catch((err)=>{
                 if(typeof(err) === "string"){