This commit is contained in:
mattyl006 2022-10-21 12:31:55 +02:00
parent 69a5c183e0
commit 68beedb4c8
3 changed files with 11 additions and 16 deletions

3
.env Normal file
View File

@ -0,0 +1,3 @@
KC_URL="https://auth-dev.csi.wmi.amu.edu.pl/"
KC_REALM="gonito-dev"
KC_CLIENT_ID="gonito-dev-heroku"

View File

@ -8,4 +8,8 @@ App will work on port 3001.
## Stop app
`docker-compose stop`
`docker-compose stop`
## Keycloak
Set variables in *.env* to choose keycloak connect.

View File

@ -1,23 +1,11 @@
import Keycloak from 'keycloak-js';
// const _kc = new Keycloak({
// url: 'https://auth-dev.csi.wmi.amu.edu.pl/',
// realm: 'gonito-dev',
// clientId: 'gonito-dev-localhost'
// });
const _kc = new Keycloak({
url: 'https://auth-dev.csi.wmi.amu.edu.pl/',
realm: 'gonito-dev',
clientId: 'gonito-dev-heroku'
url: process.env.KC_URL,
realm: process.env.KC_REALM,
clientId: process.env.KC_CLIENT_ID
});
// const _kc = new Keycloak({
// url: 'http://0.0.0.0:8080',
// realm: 'test',
// clientId: 'test'
// });
const initKeycloak = (onAuthenticatedCallback) => {
_kc.init({
onLoad: 'check-sso',