diff options
author | lonkaars <l.leblansch@gmail.com> | 2021-01-13 19:23:25 +0100 |
---|---|---|
committer | lonkaars <l.leblansch@gmail.com> | 2021-01-13 19:23:25 +0100 |
commit | 4e918ce7cbc2bb18823a233abf3dc1c6a260ecc4 (patch) | |
tree | bde86bd6190cf497c7f66c4ffd1a8d71dbb15fff /api/auth | |
parent | 26631dadc7cf1406060f2574ce3dda484066ac6a (diff) |
user registration api endpoint
Diffstat (limited to 'api/auth')
-rw-r--r-- | api/auth/signup.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/api/auth/signup.py b/api/auth/signup.py index df6a271..a568b6d 100644 --- a/api/auth/signup.py +++ b/api/auth/signup.py @@ -1,6 +1,7 @@ from flask import Blueprint, request from main import cursor, connection from randid import new_uuid +import passwords import time import json @@ -20,8 +21,8 @@ def index(): return "", 400 user_id = new_uuid() - password_salt = "salt" - password_hash = "hash" + password_salt = passwords.salt() + password_hash = passwords.password_hash(password, password_salt) registered = int( time.time() * 1000 ) cursor.execute("insert into users values (?, ?, ?, NULL, ?, ?, ?, NULL, FALSE, \"user\", \"{}\", NULL, \"online\") ", |