mirror of https://github.com/jumpserver/jumpserver
Merge pull request #10973 from jumpserver/pr@dev@fix_reset_password_bug
fix: 忘记密码token失效发送验证码报错的问题pull/10979/head
commit
696295cf0d
|
@ -1,3 +1,4 @@
|
||||||
|
from django.http import HttpResponseRedirect
|
||||||
from rest_framework.generics import CreateAPIView
|
from rest_framework.generics import CreateAPIView
|
||||||
from rest_framework.response import Response
|
from rest_framework.response import Response
|
||||||
from rest_framework.permissions import AllowAny
|
from rest_framework.permissions import AllowAny
|
||||||
|
@ -41,7 +42,7 @@ class UserResetPasswordSendCodeApi(CreateAPIView):
|
||||||
token = request.GET.get('token')
|
token = request.GET.get('token')
|
||||||
userinfo = cache.get(token)
|
userinfo = cache.get(token)
|
||||||
if not userinfo:
|
if not userinfo:
|
||||||
return reverse('authentication:forgot-previewing')
|
return HttpResponseRedirect(reverse('authentication:forgot-previewing'))
|
||||||
|
|
||||||
serializer = self.get_serializer(data=request.data)
|
serializer = self.get_serializer(data=request.data)
|
||||||
serializer.is_valid(raise_exception=True)
|
serializer.is_valid(raise_exception=True)
|
||||||
|
|
Loading…
Reference in New Issue