aboutsummaryrefslogtreecommitdiff
path: root/mu4web/user/local.py
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-11-30 04:39:50 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-11-30 04:39:50 +0100
commit1b9fb005faa6087f6b39da0bf7b634324081e890 (patch)
treeed2c6c96858f1d7487bb773c305ec3396356894e /mu4web/user/local.py
parentFix crash on invalid username. (diff)
downloadmu4web-1b9fb005faa6087f6b39da0bf7b634324081e890.tar.gz
mu4web-1b9fb005faa6087f6b39da0bf7b634324081e890.tar.xz
Work.
Diffstat (limited to 'mu4web/user/local.py')
-rw-r--r--mu4web/user/local.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/mu4web/user/local.py b/mu4web/user/local.py
new file mode 100644
index 0000000..c4485ce
--- /dev/null
+++ b/mu4web/user/local.py
@@ -0,0 +1,11 @@
+import password
+from password import Passwords
+from typing import cast
+import os
+from . import User
+
+passwords: Passwords = password.Passwords(cast(os.PathLike, 'passwords.json'))
+
+class LocalUser(User):
+ def validate(self, password: str) -> bool:
+ return passwords.validate(self._username, password)