KEYCLOAK-14707 use native promises

This commit is contained in:
Erik Jan de Wit 2020-07-09 09:25:18 +02:00 committed by Stan Silvert
parent feef5b4db2
commit 34dcbe8533

View file

@ -117,12 +117,12 @@
<body>
<script>
var keycloak = Keycloak({
const keycloak = Keycloak({
authServerUrl: authUrl,
realm: realm,
clientId: 'account-console'
});
keycloak.init({onLoad: 'check-sso', pkceMethod: 'S256'}).success(function(authenticated) {
keycloak.init({onLoad: 'check-sso', pkceMethod: 'S256', promiseType: 'native'}).then((authenticated) => {
isReactLoading = true;
toggleReact();
if (!keycloak.authenticated) {
@ -135,8 +135,7 @@
}
loadjs("/Main.js");
}).error(function() {
}).catch(() => {
alert('failed to initialize keycloak');
});
</script>