From 1cf6504bbbaf946da792985a0bd7ada6ea85a281 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 22 Apr 2021 21:35:02 +0200 Subject: implement user secrets --- api/auth/signup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'api/auth') diff --git a/api/auth/signup.py b/api/auth/signup.py index bf1208d..571adb4 100644 --- a/api/auth/signup.py +++ b/api/auth/signup.py @@ -5,6 +5,7 @@ import auth.token as token import passwords import time import re +import bcrypt # checks if the usename is between 3 and 35 charachters @@ -68,8 +69,8 @@ def index(): # write new user to database and commit cursor.execute( - "insert into users values (?, ?, ?, NULL, NULL, ?, ?, \"[]\", FALSE, \"user\", \"{}\", \"online\") ", - (user_id, username, email, password_hash, registered) + "insert into users values (?, ?, ?, NULL, NULL, ?, ?, \"[]\", FALSE, \"user\", \"{}\", ?) ", + (user_id, username, email, password_hash, registered, bcrypt.gensalt()) ) connection.commit() -- cgit v1.2.3