Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Commit

Permalink
Give a better exception when keygrip keys aren't set, and we try to hash
Browse files Browse the repository at this point in the history
a user ID
  • Loading branch information
ianb committed Nov 15, 2016
1 parent 3806219 commit cbecc70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ app.post("/error", function (req, res) {

function hashUserId(deviceId) {
return new Promise((resolve, reject) => {
if (! dbschema.getTextKeys()) {
throw new Error("Server keys not initialized");
}
let userKey = dbschema.getTextKeys()[0] + deviceId;
genUuid.generate(genUuid.V_SHA1, genUuid.nil, userKey, function (err, userUuid) {
if (err) {
Expand Down

0 comments on commit cbecc70

Please sign in to comment.