V
V
Viktor2017-09-19 05:19:03
Django
Viktor, 2017-09-19 05:19:03

How to hide authorization window if ajax response comes with WWW-Authenticate header?

How to hide authorization window if ajax response comes with WWW-Authenticate header?

I send a request via ajax to the django rest api and if my session is over, then I get a 401 response and a WWW-Authenticate header. As a result, chrome, instead of returning a response with status 401 to me in js, shows the login and password input form b155090530994c81bca7b15746dcc36a.pngand does not transfer anything to js until the person enters the correct login and password or clicks cancel.

And I want to immediately get a 401 response without showing this window to the user.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2017-09-19
@Levhav

what content-type comes in the response?
I suspect it's not the right one.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question