mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
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
|
# MUSS
|
||||||
|
|
||||||
- api: admin Login case sensitivity (username "admin" == "AdMiN")
|
|
||||||
- api: Config-Liste von Extra-Türchen (kein Buchstabe, nur manuelles Bild)
|
- api: Config-Liste von Extra-Türchen (kein Buchstabe, nur manuelles Bild)
|
||||||
- api: Config-Option "Überspringe leere Türchen" (standard ja)
|
- api: Config-Option "Überspringe leere Türchen" (standard ja)
|
||||||
|
|
||||||
|
@ -20,3 +19,4 @@
|
||||||
- Option "Leerzeichen ignorieren" (standard ja)
|
- Option "Leerzeichen ignorieren" (standard ja)
|
||||||
- Nach einigen Sekunden: Meldung "Türchen anzeigen?"
|
- Nach einigen Sekunden: Meldung "Türchen anzeigen?"
|
||||||
- `alert` durch bulma Komponente(n) ersetzen
|
- `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
|
True iff der user "admin" ist
|
||||||
"""
|
"""
|
||||||
|
|
||||||
username_correct = secrets.compare_digest(credentials.username, cfg.admin.name)
|
username_correct = secrets.compare_digest(
|
||||||
password_correct = secrets.compare_digest(credentials.password, cfg.admin.password)
|
credentials.username.lower(),
|
||||||
|
cfg.admin.name.lower(),
|
||||||
|
)
|
||||||
|
password_correct = secrets.compare_digest(
|
||||||
|
credentials.password,
|
||||||
|
cfg.admin.password,
|
||||||
|
)
|
||||||
|
|
||||||
return username_correct and password_correct
|
return username_correct and password_correct
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue