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

upon return from session context with a set userid, remember that the user has...

upon return from session context with a set userid, remember that the user has used browserid on this computer so the next time we can ask them if they'd like to stay signed in.
parent ab131350
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,8 @@ BrowserID.Network = (function() {
mediator = bid.Mediator,
xhr = bid.XHR,
post = xhr.post,
get = xhr.get;
get = xhr.get,
storage = bid.Storage;
function onContextChange(msg, result) {
context = result;
......@@ -29,6 +30,12 @@ BrowserID.Network = (function() {
auth_status = result.auth_level;
code_version = result.code_version;
// when session context returns with an authenticated user, update localstorage
// to indicate we've seen this user on this device
if (result && result.userid) {
storage.usersComputer.setSeen(result.userid);
}
// seed the PRNG
// FIXME: properly abstract this out, probably by exposing a jwcrypto
// interface for randomness
......
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