user name case sensitivity
This commit is contained in:
parent
489d64414e
commit
a86e47113c
2 changed files with 9 additions and 3 deletions
2
Ideen.md
2
Ideen.md
|
@ -1,6 +1,5 @@
|
|||
# MUSS
|
||||
|
||||
- api: admin Login case sensitivity (username "admin" == "AdMiN")
|
||||
- api: Config-Liste von Extra-Türchen (kein Buchstabe, nur manuelles Bild)
|
||||
- api: Config-Option "Überspringe leere Türchen" (standard ja)
|
||||
|
||||
|
@ -20,3 +19,4 @@
|
|||
- Option "Leerzeichen ignorieren" (standard ja)
|
||||
- Nach einigen Sekunden: Meldung "Türchen anzeigen?"
|
||||
- `alert` durch bulma Komponente(n) ersetzen
|
||||
- api: admin Login case sensitivity (username "admin" == "AdMiN")
|
||||
|
|
|
@ -19,8 +19,14 @@ async def user_is_admin(
|
|||
True iff der user "admin" ist
|
||||
"""
|
||||
|
||||
username_correct = secrets.compare_digest(credentials.username, cfg.admin.name)
|
||||
password_correct = secrets.compare_digest(credentials.password, cfg.admin.password)
|
||||
username_correct = secrets.compare_digest(
|
||||
credentials.username.lower(),
|
||||
cfg.admin.name.lower(),
|
||||
)
|
||||
password_correct = secrets.compare_digest(
|
||||
credentials.password,
|
||||
cfg.admin.password,
|
||||
)
|
||||
|
||||
return username_correct and password_correct
|
||||
|
||||
|
|
Loading…
Reference in a new issue