auth response and error codes imp
This commit is contained in:
@@ -51,7 +51,6 @@ class RedisCategoryKeys:
|
||||
PAGE_MAPPER: str = "PAGE_MAPPER"
|
||||
MENU_MAPPER: str = "MENU_MAPPER"
|
||||
|
||||
|
||||
class RedisValidationKeysAction:
|
||||
# LANGUAGE_MODELS:DYNAMIC:VALIDATIONS:
|
||||
dynamic_validation_key: str = f"{RedisValidationKeys.LANGUAGE_MODELS}:{RedisValidationKeys.DYNAMIC}:{RedisValidationKeys.VALIDATIONS}"
|
||||
|
||||
243
ApiLayers/AllConfigs/Templates/password_templates.py
Normal file
243
ApiLayers/AllConfigs/Templates/password_templates.py
Normal file
@@ -0,0 +1,243 @@
|
||||
import datetime
|
||||
|
||||
|
||||
def change_your_password_template(**kwargs):
|
||||
user_name, forgot_link, current_year = (
|
||||
kwargs["user_name"],
|
||||
kwargs["forgot_link"],
|
||||
str(datetime.datetime.now().year),
|
||||
)
|
||||
template = """<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Bootstrap demo</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f4f4f4;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.email-container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.header {
|
||||
text-align: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
}
|
||||
.header img {
|
||||
max-width: 100px;
|
||||
}
|
||||
.content {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
color: #777777;
|
||||
}
|
||||
.btn-success {
|
||||
color: #fff;
|
||||
background-color: #198754;
|
||||
border-color: #198754;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
width: 150px;
|
||||
height: 40px;
|
||||
border-radius: 5px;
|
||||
font-weight: 400;
|
||||
padding: .375rem .75rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<img src="" alt="Company Logo">
|
||||
<h2>Reset Password</h2>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>Dear %s,</p>
|
||||
<p>We have received a request to reset your password for your account with Let's Program Blog. To complete the password reset process, please click on the button below:</p>
|
||||
<p>Please note that this link is only valid for a day only. If you did not request a password reset, please disregard this message.</p>
|
||||
<a href="%s"><button type="button" class="btn-success">Reset Password</button></a>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p>© %s Evyos Ltd Şti. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
""" % (
|
||||
user_name,
|
||||
forgot_link,
|
||||
current_year,
|
||||
)
|
||||
|
||||
return template
|
||||
|
||||
|
||||
def password_is_changed_template(**kwargs):
|
||||
user_name, current_year = kwargs["user_name"], str(datetime.datetime.now().year)
|
||||
template = """
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Thank You for Changing Your Password</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f4f4f4;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.email-container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.header {
|
||||
text-align: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
}
|
||||
.header img {
|
||||
max-width: 100px;
|
||||
}
|
||||
.content {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
color: #777777;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<img src="" alt="Company Logo">
|
||||
<h2>Your Password has changed</h2>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>Dear %s,</p>
|
||||
<p>We wanted to let you know that your password has been successfully updated.
|
||||
If you did not make this change or if you believe an unauthorized person has accessed your account,
|
||||
please contact our support team immediately.</p>
|
||||
<p>Thank you for helping us keep your account secure.</p>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p>© %s Evyos Ltd Şti. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
""" % (
|
||||
user_name,
|
||||
current_year,
|
||||
)
|
||||
|
||||
return template
|
||||
|
||||
|
||||
def invalid_ip_or_address_found(**kwargs):
|
||||
user_name, current_year, address = (
|
||||
kwargs["user_name"],
|
||||
str(datetime.datetime.now().year),
|
||||
kwargs.get("address"),
|
||||
)
|
||||
template = """
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Thank You for Changing Your Password</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
background-color: #f4f4f4;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.email-container {
|
||||
max-width: 600px;
|
||||
margin: 0 auto;
|
||||
background-color: #ffffff;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.header {
|
||||
text-align: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
}
|
||||
.header img {
|
||||
max-width: 100px;
|
||||
}
|
||||
.content {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
color: #777777;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="email-container">
|
||||
<div class="header">
|
||||
<img src="" alt="Company Logo">
|
||||
<h2>An Unknown login has been attempted</h2>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>Dear %s,</p>
|
||||
<p>We wanted to let you know that an unusual login attempt has been tried from address below.
|
||||
If you have login from address below please ignore this message</p>
|
||||
<p>Thank you for helping us keep your account secure.</p>
|
||||
<h1>Address of ip attempt</h1>
|
||||
<p>City : %s</p>
|
||||
<p>Zip Code : %s</p>
|
||||
<p>Country : %s</p>
|
||||
<p>Region : %s</p>
|
||||
<p>Region Name : %s</p>
|
||||
<p>If you are not login from this address lets us now by clicking link below</p>
|
||||
<a href="%s"><button type="button" class="btn-success">Reset Password</button></a>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<p>© %s Evyos Ltd Şti. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
""" % (
|
||||
user_name,
|
||||
address["city"],
|
||||
address["zip"],
|
||||
address["country"],
|
||||
address["region"],
|
||||
address["regionName"],
|
||||
kwargs["notice_link"],
|
||||
current_year,
|
||||
)
|
||||
return template
|
||||
Reference in New Issue
Block a user