Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3040, Redirect to login page in case of Unauthorized #3092

Merged
merged 8 commits into from
Feb 25, 2015
3 changes: 3 additions & 0 deletions static-libraries/js/khan-lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ function handleFailedAPI(resp, error_prefix) {
console.log(e);
}
break;
case 401:
case 403:
// Redirect to Login Page and add the current url as next
window.location.href = USER_LOGIN_URL + "?next=" + window.location.href

This comment was marked as spam.

messages = {error: sprintf(gettext("You are not authorized to complete the request. Please <a href='%(login_url)s'>login</a> as an authorized user, then retry the request."), {
login_url: USER_LOGIN_URL
})};
Expand Down