Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement forgot password feature #5534

Merged
merged 14 commits into from
Jul 5, 2024
Prev Previous commit
Next Next commit
Minor fix
  • Loading branch information
xielong committed Jun 27, 2024
commit c02fd3a8deb48aeabc0e886269bc6d5339c041a4
1 change: 0 additions & 1 deletion api/controllers/console/workspace/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ def get(self):
class AccountForgotPasswordApi(Resource):

@setup_required
@account_initialization_required
def post(self):
parser = reqparse.RequestParser()
parser.add_argument('email', type=str, required=True, location='json')
Expand Down
2 changes: 1 addition & 1 deletion api/tasks/mail_reset_password_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def send_reset_password_mail_task(language: str, to: str, token: str):

# send invite member mail using different languages
try:
url = f'{current_app.config.get("CONSOLE_WEB_URL")}/activate?token={token}'
url = f'{current_app.config.get("CONSOLE_WEB_URL")}/forgot-password?token={token}'
if language == 'zh-Hans':
html_content = render_template('reset_password_mail_template_zh-CN.html',
to=to,
Expand Down
2 changes: 1 addition & 1 deletion api/templates/reset_password_mail_template_en-US.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="content">
<p>Dear {{ to }},</p>
<p>We have received a request to reset your password. If you initiated this request, please click the button below to reset your password:</p>
<p style="text-align: center;"><a style="color: #fff; text-decoration: none" class="button" href="{{ reset_url }}">Reset Password</a></p>
<p style="text-align: center;"><a style="color: #fff; text-decoration: none" class="button" href="{{ url }}">Reset Password</a></p>
<p>If you did not request a password reset, please ignore this email and your account will remain secure.</p>
</div>
<div class="footer">
Expand Down
2 changes: 1 addition & 1 deletion api/templates/reset_password_mail_template_zh-CN.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<div class="content">
<p>尊敬的 {{ to }},</p>
<p>我们收到了您关于重置密码的请求。如果是您本人操作,请点击以下按钮重置您的密码:</p>
<p style="text-align: center;"><a style="color: #fff; text-decoration: none" class="button" href="{{ reset_url }}">重置密码</a></p>
<p style="text-align: center;"><a style="color: #fff; text-decoration: none" class="button" href="{{ url }}">重置密码</a></p>
<p>如果您没有请求重置密码,请忽略此邮件,您的账户信息将保持安全。</p>
</div>
<div class="footer">
Expand Down