Answer the question
In order to leave comments, you need to log in
How to protect yourself from making a request while entering a url in the address bar?
The site has urls:
\login
\logout
In the process of entering the url "\login" into the address bar, letter by letter, the browser pulls the url "\logout" from the cache, automatically makes a request (for preloading chtoli?). A request arrives at the server and it is executed, as a result, the user is deauthorized.
Here is the view.py code:
def logout_view(request):
auth.logout(request)
return redirect('index_view')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question