Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 8149778

Browse files
committed
Bug: whe shouldn't be redirected while loggin in
1 parent 9ebf812 commit 8149778

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

app/assets/javascripts/casino/sessions.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(function(win, doc) {
2+
var timeoutAutoLogin;
23
var url = win.CASino.url('login'),
34
cookie_regex = /(^|;)\s*tgt=/,
45
ready_bound = false;
@@ -13,18 +14,23 @@
1314
}
1415
win.location = url;
1516
} else {
16-
setTimeout(checkCookieExists, 1000);
17+
timeoutAutoLogin = setTimeout(checkCookieExists, 1000);
1718
}
1819
}
1920

2021
// Auto-login when logged-in in other browser window (9887c4e)
22+
// @lchanouha fix, 08/2016: whe should'nt be redirected while loggin in
2123
doc.addEventListener('DOMContentLoaded', function() {
2224
if(ready_bound) {
2325
return;
2426
}
2527
ready_bound = true;
26-
if(doc.getElementById('login-form')) {
28+
var loginFrom = doc.getElementById('login-form')
29+
if(loginFrom) {
2730
checkCookieExists();
31+
loginFrom.addEventListener("submit", function(){
32+
clearTimeout(timeoutAutoLogin);
33+
});
2834
}
2935
});
3036

0 commit comments

Comments
 (0)