Skip to content

Commit

Permalink
api login指定backend (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2wang authored May 7, 2022
1 parent 6de47f7 commit f5ec82c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sql_api/api_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def post(self, request):

# 校验通过后自动登录,刷新expire_date
if result['status'] == 0 and not request.user.is_authenticated:
login(request, user)
login(request, user, backend='django.contrib.auth.backends.ModelBackend')
request.session.set_expiry(settings.SESSION_COOKIE_AGE)

return Response(result)

0 comments on commit f5ec82c

Please sign in to comment.