mirror of
https://git.wownero.com/wownero/YellWOWPages.git
synced 2024-08-15 01:03:25 +00:00
Disallow annoying chars
This commit is contained in:
parent
dc2e24c1e8
commit
4c2c955ee3
1 changed files with 5 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
import re
|
||||
|
||||
import peewee
|
||||
from quart import session, redirect, url_for
|
||||
|
||||
|
@ -14,6 +16,9 @@ async def handle_user_login(resp: dict):
|
|||
username = user['preferred_username']
|
||||
uid = user['sub']
|
||||
|
||||
if not re.match(r"^[a-zA-Z0-9_\.-]+$", username):
|
||||
raise Exception("bad username")
|
||||
|
||||
try:
|
||||
user = User.select().where(User.id == uid).get()
|
||||
except peewee.DoesNotExist:
|
||||
|
|
Loading…
Reference in a new issue