Skip to content

Commit

Permalink
fix endpoint types
Browse files Browse the repository at this point in the history
GDcheeriosYT committed Jul 25, 2024
1 parent b90932c commit d87bfc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ async def account_create(username, password, email, osu_id=0, about_me=""):


@app.route("/api/account/login/<username>+<password>")
async def login(username, password):
async def login(username, password) -> str | dict:
account = Account(username)
if account:
if bcrypt.check_password_hash(account.password, password):
@@ -116,8 +116,8 @@ async def login_cookie():
password = request.form.get('pw')
login_result = asyncio.run(login(username, password))
if login_result != "incorrect info" and login_result is not None:
resp = make_response(redirect(f'user/{login_result.id}'))
resp.set_cookie('userID', str(login_result.id))
resp = make_response(redirect(f'user/{login_result["id"]}'))
resp.set_cookie('userID', str(login_result["id"]))
return resp
else:
resp = make_response(

0 comments on commit d87bfc3

Please sign in to comment.