aboutsummaryrefslogtreecommitdiff
path: root/src/web/controllers/user.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/controllers/user.py')
-rw-r--r--src/web/controllers/user.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/web/controllers/user.py b/src/web/controllers/user.py
index ae169b05..ee2eb4c2 100644
--- a/src/web/controllers/user.py
+++ b/src/web/controllers/user.py
@@ -1,6 +1,6 @@
import random
import hashlib
-from werkzeug import generate_password_hash
+from werkzeug import generate_password_hash, check_password_hash
from .abstract import AbstractController
from web.models import User
@@ -15,6 +15,9 @@ class UserController(AbstractController):
elif 'password' in attrs:
del attrs['password']
+ def check_password(self, user, password):
+ return check_password_hash(user.pwdhash, password)
+
def create(self, **attrs):
self._handle_password(attrs)
return super().create(**attrs)
bgstack15