Open
Description
Use passport for this. We will use the 2FA code to establish a session, then the cookie will be sent on all future requests to authenticate until it expires.
Here are the steps:
- Use the
passport-session
library - Use the localStrategy as shown here http://www.passportjs.org/docs/configure/
Make sure theusername
is_id
and thepassword
is the 2FA code. You'll have to make sure the request is properly formatted for passport to automatically grab those fields. - Inside the localStrategy, do the 2FA code check
On the same page, you'll see serializeUser
and deserializeUser
. You probably need to implement those as well with ``_id`