Oren
Oren

Reputation: 21

Chrome extension popup, 302,301 redirect for django authentication

I have a chrome extension that when clicked, opens the popup which initiates an xmlhttprequest to a django website.

If the user is logged in, it displays a page and everything works fine. Else, it redirects the user (301) to the authentication page. This also works

This is where im stuck for a while: When the user submits the wrong credentials, the popup goes to the failed login page.(200) <- good If the credentials are correct, it seems as if nothing happens and the user is stuck on the login page even though there was a successful authentication and a cookie is set. in the background i can see that after the post there is a 302 redirect to the post authentication page. in django, the ?next page.

Any ideas as for why it happens? At first i thought it might be related to the 302 redirect so i changed the auth class to return 301 on a successful login but it didnt help.

Upvotes: 1

Views: 362

Answers (1)

Oren
Oren

Reputation: 21

The issue was that the first redirect came from the popup.html and the second one originated from the website. I had to move the login form to the popup.html file.

http://www.w3.org/TR/2009/WD-XMLHttpRequest-20090820/

Upvotes: 1

Related Questions