mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-12-25 08:51:51 +00:00
fix(uoj/1/app/controllers): fix login failure loop when logout from user profile modify page
When logout by clicking logout button on the top of /user/modify-profile link, you will be redirected to the login page. But if you login immediately then you will get the login page again and loop. It is caused by an address checking error. Now try to fix.
This commit is contained in:
parent
b7c10c82c3
commit
1d72c5e914
@ -89,7 +89,7 @@ function submitLoginPost() {
|
||||
}, function(msg) {
|
||||
if (msg == 'ok') {
|
||||
var prevUrl = document.referrer;
|
||||
if (prevUrl == '' || /.*\/login.*/.test(prevUrl) || /.*\/register.*/.test(prevUrl) || /.*\/reset-password.*/.test(prevUrl)) {
|
||||
if (prevUrl == '' || /.*\/login.*/.test(prevUrl) || /.*\/logout.*/.test(prevUrl) || /.*\/register.*/.test(prevUrl) || /.*\/reset-password.*/.test(prevUrl)) {
|
||||
prevUrl = '/';
|
||||
};
|
||||
window.location.href = prevUrl;
|
||||
|
Loading…
Reference in New Issue
Block a user