Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
response.on('end', function () {
if (responseData) {
responseData = JSON.parse(responseData);
if (responseData.status === 'failure') {
sendSignInComplete(data, client, null);
} else {
id = responseData.email;
pic = 'http://www.gravatar.com/avatar/' +
md5.hex_md5(id.trim().toLowerCase());
// Store the user data for next request.
redis.set('browserid-assertion-' + assertion, id);
//Add the user ID to the list of users.
redis.sadd('users', id);
//Add the user to the store
redis.hmset(id, 'id', id, 'name', id, 'pic', pic);
sendSignInComplete(data, client, {
id: id,
name: id,
pic: pic
});
}
'signIn': function (data, client) {
var id = data.userId,
name = data.userName,
clientList = clients[id] || (clients[id] = []),
pic = 'http://www.gravatar.com/avatar/' +
md5.hex_md5(id.trim().toLowerCase());
client._deuxUserId = id;
function fallbackMakeClient() {
var poco = {
displayName: name,
};
var rawClient = $rawclient.makeClientForNewIdentity(poco, db, null);
client._rawClient = rawClient;
};
var db = makeDbConn('CLIENT:' + id);
$Q.when($rawclient.getClientForExistingIdentityFromStorage(db, null),
function(rawClient) {
if (rawClient)
client._rawClient = rawClient;
else