mirror of https://github.com/jumpserver/jumpserver
fix: 修复需要设置 mfa 的 bug
parent
1c3b574c46
commit
ade3f3ae6c
|
@ -40,5 +40,7 @@ class TokenCreateApi(AuthMixin, CreateAPIView):
|
||||||
return Response(e.as_data(), status=400)
|
return Response(e.as_data(), status=400)
|
||||||
except errors.NeedMoreInfoError as e:
|
except errors.NeedMoreInfoError as e:
|
||||||
return Response(e.as_data(), status=200)
|
return Response(e.as_data(), status=200)
|
||||||
except errors.PasswordTooSimple as e:
|
except errors.MFAUnsetError:
|
||||||
return redirect(e.url)
|
return Response({'error': 'MFA unset, please set first'}, status=400)
|
||||||
|
except Exception as e:
|
||||||
|
return Response({"error": str(e)}, status=400)
|
||||||
|
|
Loading…
Reference in New Issue