mirror of https://github.com/jumpserver/jumpserver
fix: 重置密码连接生成多个token
parent
870dac37b9
commit
d22bb2c92f
|
@ -7,6 +7,11 @@ from notifications.notifications import UserMessage
|
|||
|
||||
|
||||
class ResetPasswordMsg(UserMessage):
|
||||
|
||||
def __init__(self, user):
|
||||
super().__init__(user)
|
||||
self.reset_passwd_token = user.generate_reset_token()
|
||||
|
||||
def get_text_msg(self) -> dict:
|
||||
user = self.user
|
||||
subject = _('Reset password')
|
||||
|
@ -30,7 +35,7 @@ Login direct 👇
|
|||
""") % {
|
||||
'name': user.name,
|
||||
'rest_password_url': reverse('authentication:reset-password', external=True),
|
||||
'rest_password_token': user.generate_reset_token(),
|
||||
'rest_password_token': self.reset_passwd_token,
|
||||
'forget_password_url': reverse('authentication:forgot-password', external=True),
|
||||
'email': user.email,
|
||||
'login_url': reverse('authentication:login', external=True),
|
||||
|
@ -62,7 +67,7 @@ Login direct 👇
|
|||
""") % {
|
||||
'name': user.name,
|
||||
'rest_password_url': reverse('authentication:reset-password', external=True),
|
||||
'rest_password_token': user.generate_reset_token(),
|
||||
'rest_password_token': self.reset_passwd_token,
|
||||
'forget_password_url': reverse('authentication:forgot-password', external=True),
|
||||
'email': user.email,
|
||||
'login_url': reverse('authentication:login', external=True),
|
||||
|
|
Loading…
Reference in New Issue