Skip to content

Commit

Permalink
postbeta
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Sep 19, 2023
1 parent 410b1a4 commit 2622fc9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/server",
"version": "0.53.0",
"version": "0.54.0",
"description": "",
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.11",
Expand Down
4 changes: 2 additions & 2 deletions server/src/scrypted-server-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,13 @@ async function start(mainFilename: string, options?: {
basicChecker(req, res);
});

const user = await db.tryGet(ScryptedUser, username);
const user = await db.tryGet(ScryptedUser, username) as ScryptedUser;
if (!user.token) {
user.token = crypto.randomBytes(16).toString('hex');
await db.upsert(user);
}

const userToken = new UserToken(res.locals.username, res.locals.aclId, Date.now());
const userToken = new UserToken(user._id, user.aclId, Date.now());

res.send({
...createTokens(userToken),
Expand Down

0 comments on commit 2622fc9

Please sign in to comment.