lol
This commit is contained in:
+698
-105
@@ -1082,57 +1082,333 @@ def api_update_email(
|
|||||||
@app.get(
|
@app.get(
|
||||||
"/verify-email",
|
"/verify-email",
|
||||||
response_class=HTMLResponse,
|
response_class=HTMLResponse,
|
||||||
|
summary="Verify email address",
|
||||||
)
|
)
|
||||||
def api_verify_email(token: str = Query(...)):
|
def api_verify_email(
|
||||||
|
token: str = Query(...),
|
||||||
|
):
|
||||||
result = verify_email(token)
|
result = verify_email(token)
|
||||||
|
|
||||||
if result["status"] == "failed":
|
if result["status"] == "failed":
|
||||||
if result["reason"] == "token_expired":
|
if result["reason"] == "token_expired":
|
||||||
return """
|
return HTMLResponse(
|
||||||
<!DOCTYPE html>
|
content="""
|
||||||
<html lang="en">
|
<!DOCTYPE html>
|
||||||
<head>
|
<html lang="en">
|
||||||
<meta charset="UTF-8">
|
<head>
|
||||||
<title>Verification expired</title>
|
<meta charset="UTF-8">
|
||||||
</head>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<body>
|
|
||||||
<h1>Verification expired</h1>
|
|
||||||
<p>This verification link has expired.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
return """
|
<title>Verification expired</title>
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Verification failed</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Verification failed</h1>
|
|
||||||
<p>This verification link is invalid.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
return """
|
<style>
|
||||||
<!DOCTYPE html>
|
* {
|
||||||
<html lang="en">
|
box-sizing: border-box;
|
||||||
<head>
|
}
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
body {
|
||||||
<title>Email verified</title>
|
margin: 0;
|
||||||
</head>
|
min-height: 100vh;
|
||||||
<body>
|
display: flex;
|
||||||
<div class="box">
|
align-items: center;
|
||||||
<h1>Email verified</h1>
|
justify-content: center;
|
||||||
<p>Your email address has been successfully verified.</p>
|
padding: 24px;
|
||||||
<p>You may now close this tab.</p>
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family:
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin: 0 auto 24px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #2b2115;
|
||||||
|
color: #f0a83b;
|
||||||
|
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 28px;
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #272c33;
|
||||||
|
|
||||||
|
color: #6f7782;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<div class="icon">!</div>
|
||||||
|
|
||||||
|
<h1>Verification expired</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This email verification link has expired.
|
||||||
|
Please request a new verification email.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Calendar API
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</main>
|
||||||
</html>
|
</body>
|
||||||
"""
|
</html>
|
||||||
|
""",
|
||||||
|
status_code=410,
|
||||||
|
)
|
||||||
|
|
||||||
|
return HTMLResponse(
|
||||||
|
content="""
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>Verification failed</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family:
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin: 0 auto 24px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #2a1719;
|
||||||
|
color: #ef6461;
|
||||||
|
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 28px;
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #272c33;
|
||||||
|
|
||||||
|
color: #6f7782;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<div class="icon">×</div>
|
||||||
|
|
||||||
|
<h1>Verification failed</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This verification link is invalid or has already been used.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Calendar API
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
status_code=400,
|
||||||
|
)
|
||||||
|
|
||||||
|
return HTMLResponse(
|
||||||
|
content="""
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>Email verified</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family:
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin: 0 auto 24px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #14271d;
|
||||||
|
color: #4ade80;
|
||||||
|
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
font-size: 26px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 8px 0 0;
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
margin-top: 28px;
|
||||||
|
padding-top: 20px;
|
||||||
|
border-top: 1px solid #272c33;
|
||||||
|
|
||||||
|
color: #6f7782;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<div class="icon">✓</div>
|
||||||
|
|
||||||
|
<h1>Email verified</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Your email address has been successfully verified.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
You may now close this tab.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Calendar API
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
|
||||||
@app.post(
|
@app.post(
|
||||||
"/forgot-password",
|
"/forgot-password",
|
||||||
@@ -1147,47 +1423,194 @@ def api_forgot_password(
|
|||||||
@app.get(
|
@app.get(
|
||||||
"/update-password_page",
|
"/update-password_page",
|
||||||
response_class=HTMLResponse,
|
response_class=HTMLResponse,
|
||||||
|
summary="Password reset page",
|
||||||
)
|
)
|
||||||
def update_password_page(token: str = Query(...)):
|
def update_password_page(
|
||||||
return f"""
|
token: str = Query(...),
|
||||||
<!DOCTYPE html>
|
):
|
||||||
<html lang="en">
|
return HTMLResponse(
|
||||||
<head>
|
content=f"""
|
||||||
<meta charset="UTF-8">
|
<!DOCTYPE html>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<html lang="en">
|
||||||
<title>Reset password</title>
|
<head>
|
||||||
</head>
|
<meta charset="UTF-8">
|
||||||
<body>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>Reset password</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
* {{
|
||||||
|
box-sizing: border-box;
|
||||||
|
}}
|
||||||
|
|
||||||
|
body {{
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family:
|
||||||
|
system-ui,
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
sans-serif;
|
||||||
|
}}
|
||||||
|
|
||||||
|
.card {{
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
}}
|
||||||
|
|
||||||
|
h1 {{
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 28px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
.description {{
|
||||||
|
margin: 0 0 30px;
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}}
|
||||||
|
|
||||||
|
label {{
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
color: #c7ccd3;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}}
|
||||||
|
|
||||||
|
input {{
|
||||||
|
width: 100%;
|
||||||
|
padding: 13px 14px;
|
||||||
|
|
||||||
|
border: 1px solid #343a43;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
background: #0f1216;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-size: 15px;
|
||||||
|
|
||||||
|
outline: none;
|
||||||
|
}}
|
||||||
|
|
||||||
|
input:focus {{
|
||||||
|
border-color: #6b7280;
|
||||||
|
}}
|
||||||
|
|
||||||
|
button {{
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 22px;
|
||||||
|
padding: 13px 16px;
|
||||||
|
|
||||||
|
border: 0;
|
||||||
|
border-radius: 8px;
|
||||||
|
|
||||||
|
background: #e8eaed;
|
||||||
|
color: #111318;
|
||||||
|
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
|
||||||
|
cursor: pointer;
|
||||||
|
}}
|
||||||
|
|
||||||
|
button:hover {{
|
||||||
|
background: #ffffff;
|
||||||
|
}}
|
||||||
|
|
||||||
|
.requirements {{
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
color: #6f7782;
|
||||||
|
font-size: 13px;
|
||||||
|
}}
|
||||||
|
|
||||||
|
.footer {{
|
||||||
|
margin-top: 28px;
|
||||||
|
padding-top: 20px;
|
||||||
|
|
||||||
|
border-top: 1px solid #272c33;
|
||||||
|
|
||||||
|
color: #6f7782;
|
||||||
|
font-size: 13px;
|
||||||
|
text-align: center;
|
||||||
|
}}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
|
||||||
<h1>Reset password</h1>
|
<h1>Reset password</h1>
|
||||||
|
|
||||||
<form method="post" action="/api/update-password">
|
<p class="description">
|
||||||
|
Enter a new password for your account.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<form
|
||||||
|
method="post"
|
||||||
|
action="/update-password"
|
||||||
|
>
|
||||||
<input
|
<input
|
||||||
type="hidden"
|
type="hidden"
|
||||||
name="token"
|
name="token"
|
||||||
value="{token}"
|
value="{token}"
|
||||||
>
|
>
|
||||||
|
|
||||||
<label>
|
<label for="new_password">
|
||||||
New password:
|
New password
|
||||||
<input
|
|
||||||
type="password"
|
|
||||||
name="new_password"
|
|
||||||
minlength="8"
|
|
||||||
required
|
|
||||||
>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<input
|
||||||
|
id="new_password"
|
||||||
|
type="password"
|
||||||
|
name="new_password"
|
||||||
|
minlength="8"
|
||||||
|
autocomplete="new-password"
|
||||||
|
required
|
||||||
|
>
|
||||||
|
|
||||||
|
<div class="requirements">
|
||||||
|
Minimum 8 characters.
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="submit">
|
<button type="submit">
|
||||||
Reset password
|
Update password
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
|
||||||
</html>
|
<div class="footer">
|
||||||
"""
|
Calendar API
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
|
||||||
@app.post(
|
@app.post(
|
||||||
"/update-password",
|
"/update-password",
|
||||||
response_class=HTMLResponse,
|
response_class=HTMLResponse,
|
||||||
|
summary="Reset password",
|
||||||
)
|
)
|
||||||
def update_password(
|
def update_password(
|
||||||
token: str = Form(...),
|
token: str = Form(...),
|
||||||
@@ -1199,49 +1622,219 @@ def update_password(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if result["status"] == "failed":
|
if result["status"] == "failed":
|
||||||
|
|
||||||
if result["reason"] == "token_expired":
|
if result["reason"] == "token_expired":
|
||||||
return """
|
return HTMLResponse(
|
||||||
<!DOCTYPE html>
|
content="""
|
||||||
<html lang="en">
|
<!DOCTYPE html>
|
||||||
<head>
|
<html lang="en">
|
||||||
<meta charset="UTF-8">
|
<head>
|
||||||
<title>Reset expired</title>
|
<meta charset="UTF-8">
|
||||||
</head>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<body>
|
|
||||||
<h1>Reset link expired</h1>
|
|
||||||
<p>This password reset link has expired.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
|
|
||||||
return """
|
<title>Reset link expired</title>
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
<style>
|
||||||
<head>
|
body {
|
||||||
<meta charset="UTF-8">
|
margin: 0;
|
||||||
<title>Reset failed</title>
|
min-height: 100vh;
|
||||||
</head>
|
display: flex;
|
||||||
<body>
|
align-items: center;
|
||||||
<h1>Reset failed</h1>
|
justify-content: center;
|
||||||
<p>This password reset link is invalid.</p>
|
padding: 24px;
|
||||||
</body>
|
|
||||||
</html>
|
background: #0b0d10;
|
||||||
"""
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0,0,0,.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<h1>Reset link expired</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This password reset link has expired.
|
||||||
|
Please request a new password reset.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
status_code=410,
|
||||||
|
)
|
||||||
|
|
||||||
|
return HTMLResponse(
|
||||||
|
content="""
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>Reset failed</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0,0,0,.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<h1>Reset failed</h1>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
This password reset link is invalid or has already been used.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
status_code=400,
|
||||||
|
)
|
||||||
|
|
||||||
|
return HTMLResponse(
|
||||||
|
content="""
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
|
<title>Password updated</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
|
||||||
|
background: #0b0d10;
|
||||||
|
color: #e8eaed;
|
||||||
|
|
||||||
|
font-family: system-ui, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 460px;
|
||||||
|
padding: 40px;
|
||||||
|
|
||||||
|
background: #15181d;
|
||||||
|
border: 1px solid #2a2f36;
|
||||||
|
border-radius: 14px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 20px 60px rgba(0,0,0,.45);
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
margin: 0 auto 24px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #14271d;
|
||||||
|
color: #4ade80;
|
||||||
|
|
||||||
|
font-size: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
color: #9da4ae;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<main class="card">
|
||||||
|
<div class="icon">✓</div>
|
||||||
|
|
||||||
return """
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<title>Password updated</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>Password updated</h1>
|
<h1>Password updated</h1>
|
||||||
<p>Your password has been successfully changed.</p>
|
|
||||||
<p>You may now close this tab.</p>
|
<p>
|
||||||
</body>
|
Your password has been successfully changed.
|
||||||
</html>
|
</p>
|
||||||
"""
|
|
||||||
|
<p>
|
||||||
|
You may now close this tab.
|
||||||
|
</p>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
|
||||||
# easter egg
|
# easter egg
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user