Skip to content

Instantly share code, notes, and snippets.

@bandrzejczak
Created February 9, 2018 22:20
Show Gist options
  • Save bandrzejczak/62c2f626312ffeb04355116a117820a8 to your computer and use it in GitHub Desktop.
Save bandrzejczak/62c2f626312ffeb04355116a117820a8 to your computer and use it in GitHub Desktop.
var updateTokenInterval = $interval(function () {
// refresh token if it's valid for less then 15 minutes
keycloak.updateToken(15)
.success(function (refreshed) {
if (refreshed) {
$cookies.put('X-Authorization-Token', keycloak.token);
}
});
}, 10000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment