When you click the email link, you will land on the following page


This will work only when we have React frontend. To try this using Postman, copy the token after /account-activate/ and use in Postman to send a POST request to /api/register endpoint

Create register endpoint

// routes/auth
router.post("/register", auth.register);

// controllers/auth
export const register = async (req, res) => {
  try {
    const decoded = jwt.verify(req.body.token, config.JWT_SECRET);
    console.log(decoded); // email , password
  } catch (err) {
    res.json({ error: "Could not complete registration. Try again." });

To try it, use Postman to make a POST request by sending token in req.body

// url

// token in body
    "token": "eyJhbGciOiJIUzI565cCI6IkpXVCJ9.eyJlbWFpbCI6Im1lcm5jbXNAZ21haWwuY29tIiwicGFzc3dvcmQ56CJpYXQiOjE2NzE2MTAzNjAsImV4cCI6MTY3MTYxMzk2MH0.6H1Yl56-Vdbs6TLYR3KexTMjWBDPT9ffnqqE5p06V8"