diff options
author | rsiddharth <s@ricketyspace.net> | 2019-09-13 22:07:23 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2019-09-13 22:07:23 -0400 |
commit | f6b1d5dcbf800681c2060eb0c716d195a9e65238 (patch) | |
tree | 1acdd9ff09193b6dea00842c4a9d617a4fbb5b60 /nfsw | |
parent | 53d9204a98fa7eb3ab5d8cf9d1f8dfeea5a5baff (diff) |
nfsw/auth.py: Remove login.
Diffstat (limited to 'nfsw')
-rw-r--r-- | nfsw/auth.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/nfsw/auth.py b/nfsw/auth.py index 3d358d4..7eec2a7 100644 --- a/nfsw/auth.py +++ b/nfsw/auth.py @@ -15,35 +15,6 @@ from nfsw.db import get_db bp = Blueprint('auth', __name__) -def login(username, password): - db = get_db() - - user = db.execute('SELECT * FROM user WHERE username=?', (username,) - ).fetchone() - - if user is None: - return { - 'status': 'error', - 'msg': 'User not found', - 'fields': ['username'] - } - - if not check_password_hash(user['password'], password): - return { - 'status': 'error', - 'msg': 'Password is incorrect', - 'fields': ['password'] - } - - session.clear() - session['user_id'] = user['id'] - - return { - 'status': 'ok', - 'url': url_for('hello') - } - - def register(username): db = get_db() |