Skip to content

Commit

Permalink
add check for non-existant user
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Mar 18, 2023
1 parent 0be9133 commit 00ad70f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/database/sqlite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ export class SQLiteAdapter extends Database {
public async getUser(email: string): Promise<any> {
return new Promise((resolve, reject) => {
db.get(`SELECT * FROM authentication WHERE email = ?`, [email], (err: any, row: any) => {
if (err || !row) {
if (err) {
reject(err);
console.log(`[database:sqlite] failed to get user ${email}`);
} else if (!row) {
resolve(null);
} else {
resolve({
...row,
Expand Down

0 comments on commit 00ad70f

Please sign in to comment.