summaryrefslogtreecommitdiffstats
path: root/nfsw/auth.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-09-13 22:07:42 -0400
committerrsiddharth <s@ricketyspace.net>2019-09-13 22:07:42 -0400
commit24864db953b76faf429251de7b8a369b94549c1b (patch)
tree238785619a3d33ecfd6b46f0216cb8eedc25c3e1 /nfsw/auth.py
parentf6b1d5dcbf800681c2060eb0c716d195a9e65238 (diff)
nfsw/auth.py: Remove register.
Diffstat (limited to 'nfsw/auth.py')
-rw-r--r--nfsw/auth.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/nfsw/auth.py b/nfsw/auth.py
index 7eec2a7..7c7b1a2 100644
--- a/nfsw/auth.py
+++ b/nfsw/auth.py
@@ -15,31 +15,4 @@ from nfsw.db import get_db
bp = Blueprint('auth', __name__)
-def register(username):
- db = get_db()
-
- if db.execute('SELECT id FROM user where username=?', (username,)
- ).fetchone() is not None:
- return {
- 'status': 'pass',
- 'msg': 'Looks you\'ve registered before!'
- + ' Gimme your password. Pretty please.'
- }
-
- password = os.urandom(4).hex()
-
- r = db.execute('INSERT INTO user (username, password) VALUES (?, ?)',
- (username, generate_password_hash(password)))
- db.commit()
-
- print(r.fetchone)
- print(password)
-
- session.clear()
- session['newuser'] = True
-
- return {
- 'status': 'ok',
- 'url': url_for('hello')
- }