Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

A bug in c-promiseAuth.js #5

@sembug

Description

@sembug

Hi Jordan! Nice work in your Reactive Native course. Congrats!
I find a bug in your code.
The variable user is not available in this "then", right?

.then(function(isMatch) {
      // have to throw in order to break Promise chain
      if (!isMatch) {
        res.status(401).send('Incorrect password')
        throw {earlyExit: true}
      }
      const payload = {id: user._id, email: user.email}
      return jwt.sign(payload, config.secret, {})
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions