Open simevidas opened 8 years ago
Ok, I’ve looked in the “sessions” database. Passwordless adds a field. It looks like req.user === req.session.passwordless
. Good to know!
Sorry about the confusion; I wasn’t sure how req.user
relates to the session, but I think it’s more clear to me now.
It would still be great to have a one-time handler to add extra fields to the session, though.
In my case, I need a successful handler that pass origin
url.
Duplicated #67
Note: See my comment below.
I’m switching from Mozilla Persona to Passwordless. Persona provided a callback after it verified a visitor’s email; in this callback, I would store the visitor’s information in the
req.session
object, which persists across page views and sessions (it think, it works via a persistent session cookie, but I’m not sure).Basically:
req.session.email
automaticallyreq.session
object (req.session.active = true
, etc.)if (req.session.active) { /* active subscriber */ }
If Passwordless provided a success handler after a token is accepted, I could use it to write to
req.session
like I did with Persona. I hope this is possible somehow.I guess, I could do:
but that runs during every request, so doing it once inside an
acceptToken
handler would be preferred 😅.