removed unused endpoint

This commit is contained in:
2025-12-16 01:55:09 +10:00
parent a24c1f0957
commit 06900e2768
4 changed files with 118 additions and 17 deletions

View File

@@ -125,7 +125,7 @@ async def welcome(request: Request):
if not login or not password:
return RedirectResponse(url="/login")
cursor.execute(
f"SELECT * FROM users WHERE login='{login}' AND password='{password}'"
f"SELECT login FROM users WHERE login='{login}' AND password='{password}'"
)
user = cursor.fetchall()
if user:
@@ -133,7 +133,7 @@ async def welcome(request: Request):
<html>
<head><title>Добро пожаловать</title>{STYLES}</head>
<body>
<h1>Привет, {login}</h1>
<h1>Привет, {user}</h1>
<button onclick="
document.cookie = 'login=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
document.cookie = 'password=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
@@ -148,13 +148,6 @@ async def welcome(request: Request):
return RedirectResponse(url="/login")
@app.post("/logout")
async def logout():
response = RedirectResponse(url="/login", status_code=302)
response.delete_cookie("login")
response.delete_cookie("password")
return response
@app.get("/", include_in_schema=False)
async def root():