Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
WebUI
Commits
72f1dbaa
Commit
72f1dbaa
authored
Jun 04, 2019
by
Lionel Morin
Browse files
Merge branch 'keycloak_refresh' into 'develop'
handle keyclaok refresh token See merge request
!7
parents
6e2b7249
2ee83e23
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.js
View file @
72f1dbaa
...
...
@@ -45,13 +45,22 @@ const app = (
);
keycloak
.
init
({
onLoad
:
'
login-required
'
,
token
,
refreshToken
})
.
then
(
authenticated
=>
{
.
success
(
authenticated
=>
{
if
(
authenticated
)
{
store
.
getState
().
keycloak
=
keycloak
;
updateLocalStorage
();
keycloak
.
updateToken
(
10
).
error
(()
=
>
keycloak
.
logout
())
;
updateLocalStorage
();
if
(
sessionStorage
.
getItem
(
'
kc_token
'
)
!=
null
){
ReactDOM
.
render
(
app
,
document
.
getElementById
(
'
root
'
));
}
if
(
sessionStorage
.
getItem
(
'
kc_token
'
)
!=
null
){
ReactDOM
.
render
(
app
,
document
.
getElementById
(
'
root
'
));
}
setInterval
(()
=>
{
keycloak
.
updateToken
(
10
).
error
(()
=>
keycloak
.
logout
());
console
.
log
(
"
KEYCLOAK
"
)
sessionStorage
.
setItem
(
'
kctoken
'
,
keycloak
.
token
);
},
10000
);
}
else
{
keycloak
.
login
();
}
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment