misc: replace PASSWORD_RESET_TIMEOUT_DAYS by PASSWORD_RESET_TIMEOUT (#81386)
gitea/authentic/pipeline/head This commit looks good
Details
gitea/authentic/pipeline/head This commit looks good
Details
This commit is contained in:
parent
27cb40221d
commit
9bdae8c033
|
@ -897,7 +897,7 @@ def build_reset_password_url(user, request=None, next_url=None, set_random_passw
|
|||
if set_random_password:
|
||||
user.set_password(uuid.uuid4().hex)
|
||||
user.save()
|
||||
lifetime = settings.PASSWORD_RESET_TIMEOUT_DAYS * 3600 * 24
|
||||
lifetime = settings.PASSWORD_RESET_TIMEOUT
|
||||
# invalidate any token associated with this user
|
||||
Token.objects.filter(kind='pw-reset', content__user=user.pk, content__email=user.email).delete()
|
||||
token = Token.create('pw-reset', {'user': user.pk, 'email': user.email}, duration=lifetime)
|
||||
|
@ -945,7 +945,7 @@ def send_password_reset_mail(
|
|||
{
|
||||
'user': user,
|
||||
'email': user.email,
|
||||
'expiration_days': settings.PASSWORD_RESET_TIMEOUT_DAYS,
|
||||
'expiration_days': settings.PASSWORD_RESET_TIMEOUT // 86400,
|
||||
'site': request.get_host() if request else '',
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue