Merge pull request #3549 from RamonGebben/patch-1

KEYCLOAK-3993: Removed compare bug in `checkState` function
This commit is contained in:
Stian Thorgersen
2016-12-01 07:57:29 +01:00
committed by GitHub

View File

@@ -35,14 +35,14 @@
req.open('GET', url, true);
req.onreadystatechange = function () {
if (req.readyState == 4) {
if (req.status == 204) {
if (req.readyState === 4) {
if (req.status === 204) {
init = {
clientId: clientId,
origin: origin
}
callback('unchanged');
} else if (req.status = 404) {
} else if (req.status === 404) {
callback('changed');
} else {
callback('error');
@@ -52,8 +52,8 @@
req.send();
} else {
if (clientId == init.clientId && origin == init.origin) {
if (sessionState == cookie) {
if (clientId === init.clientId && origin === init.origin) {
if (sessionState === cookie) {
callback('unchanged');
} else {
callback('changed');
@@ -71,7 +71,7 @@
for(var i=0; i<ca.length; i++)
{
var c = ca[i].trim();
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
if (c.indexOf(name)===0) return c.substring(name.length,c.length);
}
return null;
}
@@ -95,4 +95,4 @@
window.addEventListener("message", receiveMessage, false);
</script>
</body>
</html>
</html>