🎨 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>
|
||||
<body>
|
||||
<script>
|
||||
parent.postMessage(location.href, location.origin)
|
||||
</script>
|
||||
<script>
|
||||
parent.postMessage(location.href, location.origin)
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
----
|
||||
|
@ -467,11 +467,12 @@ For example:
|
|||
|
||||
[source,javascript]
|
||||
----
|
||||
keycloak.loadUserProfile().then(function(profile) {
|
||||
alert(JSON.stringify(profile, null, " "));
|
||||
}).catch(function() {
|
||||
alert('Failed to load user profile');
|
||||
});
|
||||
keycloak.loadUserProfile()
|
||||
.then(function(profile) {
|
||||
alert(JSON.stringify(profile, null, " "))
|
||||
}).catch(function() {
|
||||
alert('Failed to load user profile');
|
||||
});
|
||||
----
|
||||
|
||||
====== isTokenExpired(minValidity)
|
||||
|
@ -489,15 +490,16 @@ For example:
|
|||
|
||||
[source,javascript]
|
||||
----
|
||||
keycloak.updateToken(5).then(function(refreshed) {
|
||||
if (refreshed) {
|
||||
alert('Token was successfully refreshed');
|
||||
} else {
|
||||
alert('Token is still valid');
|
||||
}
|
||||
}).catch(function() {
|
||||
alert('Failed to refresh the token, or the session has expired');
|
||||
});
|
||||
keycloak.updateToken(5)
|
||||
.then(function(refreshed) {
|
||||
if (refreshed) {
|
||||
alert('Token was successfully refreshed');
|
||||
} else {
|
||||
alert('Token is still valid');
|
||||
}
|
||||
}).catch(function() {
|
||||
alert('Failed to refresh the token, or the session has expired');
|
||||
});
|
||||
----
|
||||
|
||||
====== clearToken()
|
||||
|
|
Loading…
Reference in a new issue