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}'"