From d4358479f6f6fff6df0a29d88f2f8c59f72235bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 9 May 2019 14:33:43 +0200 Subject: [PATCH] sqldb cleanup --- backend/db.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/db.coffee b/backend/db.coffee index bd16241..686aec5 100644 --- a/backend/db.coffee +++ b/backend/db.coffee @@ -99,14 +99,13 @@ class FFTCGDB stmt.finalize() if err logger.warn "reg: FAIL db '#{err.code}' for '#{login}'" - reject messages.exists # user already exists + # user already exists + reject messages.exists else logger.info "reg: OK '#{login}'" # registration successful - resolve - user: @lastID - login: login + resolve null .catch -> reject messages.empty @@ -117,7 +116,7 @@ class FFTCGDB @validate login, password .then => # get users table row - stmt = @db.prepare 'SELECT user, login, pwdhash FROM users WHERE login = ?' + stmt = @db.prepare 'SELECT * FROM users WHERE login = ?' stmt.get [login], (err, row) => stmt.finalize() if err @@ -142,6 +141,7 @@ class FFTCGDB resolve user: row.user login: row.login + settings: row.settings else logger.debug "login: FAIL password for '#{login}'"