Skip to content

Commit

Permalink
feat: add token login
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Dec 12, 2023
1 parent 49ce9cf commit d62e9cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dongtai_web/views/user_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def get(self, request: Request):
url = request.GET.get("url", "/")
token = request.GET.get("token")
token_obj = Token.objects.filter(key=token).first()
if not url.startswith("/"):
url = "/"
if token_obj is not None:
login(request, token_obj.user)
return HttpResponseRedirect(url)

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
Expand Down

0 comments on commit d62e9cf

Please sign in to comment.