Skip to content
Snippets Groups Projects
Commit 3e693de0 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

fix bug where we wouldn't know the userid immediately after authentication. ...

fix bug where we wouldn't know the userid immediately after authentication.  return userid from authenticate_user api and set it upon successful auth.
parent 2e5a1da9
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ exports.process = function(req, res) {
wsapi.authenticateSession(req.session, uid, 'password',
req.body.ephemeral ? config.get('ephemeral_session_duration_ms') : undefined);
res.json({ success: true });
res.json({ success: true, userid: uid });
// if the work factor has changed, update the hash here. issue #204
......
......@@ -63,6 +63,11 @@ BrowserID.Network = (function() {
if (typeof authenticated !== 'boolean') throw status;
// now update the userid which is set once the user is authenticated.
// this is used to key off client side state, like whether this user has
// confirmed ownership of this device
userid = status.userid;
// at this point we know the authentication status of the
// session, let's set it to perhaps save a network request
// (to fetch session context).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment