From 79825dfa1dd512e0e2936a55392bb387f804eeaa Mon Sep 17 00:00:00 2001 From: Ramon Gebben Date: Fri, 25 Nov 2016 11:45:40 +0100 Subject: [PATCH] Removed compare bug in `checkState` function --- .../main/resources/login-status-iframe.html | 175 +++++++++--------- 1 file changed, 88 insertions(+), 87 deletions(-) diff --git a/adapters/oidc/js/src/main/resources/login-status-iframe.html b/adapters/oidc/js/src/main/resources/login-status-iframe.html index 6bea92ade4..1ddc38a0e3 100755 --- a/adapters/oidc/js/src/main/resources/login-status-iframe.html +++ b/adapters/oidc/js/src/main/resources/login-status-iframe.html @@ -1,98 +1,99 @@ +~ Copyright 2016 Red Hat, Inc. and/or its affiliates +~ and other contributors as indicated by the @author tags. +~ +~ Licensed under the Apache License, Version 2.0 (the "License"); +~ you may not use this file except in compliance with the License. +~ You may obtain a copy of the License at +~ +~ http://www.apache.org/licenses/LICENSE-2.0 +~ +~ Unless required by applicable law or agreed to in writing, software +~ distributed under the License is distributed on an "AS IS" BASIS, +~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +~ See the License for the specific language governing permissions and +~ limitations under the License. +--> - + return null; + } + + function receiveMessage(event) { + var origin = event.origin, + data = event.data.split(' '), + clientId = data[0], + sessionState = data[1]; + + if (data.length !== 2) { + event.source.postMessage('error', origin); + } + + checkState(clientId, event.origin, sessionState, function (result) { + event.source.postMessage(result, origin); + }); + } + + window.addEventListener('message', receiveMessage, false); + - \ No newline at end of file +