smaller refactorings

This commit is contained in:
azivner
2018-04-02 22:53:01 -04:00
parent a4e64350e9
commit 42dd8d4754
11 changed files with 32 additions and 69 deletions

View File

@@ -20,8 +20,9 @@ async function login(req) {
return [401, "Incorrect username/password"];
}
const apiToken = new ApiToken({ token: utils.randomSecureToken() });
await apiToken.save();
const apiToken = await new ApiToken({
token: utils.randomSecureToken()
}).save();
return {
token: apiToken.token