🎨 fixed inconsinstent example code indentations (#749)
Some of the code examples used 2 spaces, and some were wrongly indented. This PR fixes the inconsistent JavaScript indentation to 4 spaces, and ensures that opening and closing brackets/braces are placed on the same indentation
This commit is contained in:
parent
73a9c8af1c
commit
f3b2913ad3
1 changed files with 19 additions and 17 deletions
|
@ -83,9 +83,9 @@ It has no other task than sending the received tokens to the main application an
|
||||||
----
|
----
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
parent.postMessage(location.href, location.origin)
|
parent.postMessage(location.href, location.origin)
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
----
|
----
|
||||||
|
@ -467,11 +467,12 @@ For example:
|
||||||
|
|
||||||
[source,javascript]
|
[source,javascript]
|
||||||
----
|
----
|
||||||
keycloak.loadUserProfile().then(function(profile) {
|
keycloak.loadUserProfile()
|
||||||
alert(JSON.stringify(profile, null, " "));
|
.then(function(profile) {
|
||||||
}).catch(function() {
|
alert(JSON.stringify(profile, null, " "))
|
||||||
alert('Failed to load user profile');
|
}).catch(function() {
|
||||||
});
|
alert('Failed to load user profile');
|
||||||
|
});
|
||||||
----
|
----
|
||||||
|
|
||||||
====== isTokenExpired(minValidity)
|
====== isTokenExpired(minValidity)
|
||||||
|
@ -489,15 +490,16 @@ For example:
|
||||||
|
|
||||||
[source,javascript]
|
[source,javascript]
|
||||||
----
|
----
|
||||||
keycloak.updateToken(5).then(function(refreshed) {
|
keycloak.updateToken(5)
|
||||||
if (refreshed) {
|
.then(function(refreshed) {
|
||||||
alert('Token was successfully refreshed');
|
if (refreshed) {
|
||||||
} else {
|
alert('Token was successfully refreshed');
|
||||||
alert('Token is still valid');
|
} else {
|
||||||
}
|
alert('Token is still valid');
|
||||||
}).catch(function() {
|
}
|
||||||
alert('Failed to refresh the token, or the session has expired');
|
}).catch(function() {
|
||||||
});
|
alert('Failed to refresh the token, or the session has expired');
|
||||||
|
});
|
||||||
----
|
----
|
||||||
|
|
||||||
====== clearToken()
|
====== clearToken()
|
||||||
|
|
Loading…
Reference in a new issue