2020-09-01 14:51:59 +00:00
|
|
|
import Keycloak, { KeycloakInstance } from "keycloak-js";
|
2020-10-14 12:53:51 +00:00
|
|
|
const keycloak: KeycloakInstance = Keycloak("/keycloak.json");
|
2020-08-04 12:59:41 +00:00
|
|
|
|
|
|
|
export default async function (): Promise<KeycloakInstance> {
|
2020-09-01 14:51:59 +00:00
|
|
|
await keycloak.init({ onLoad: "check-sso", pkceMethod: "S256" }).catch(() => {
|
|
|
|
alert("failed to initialize keycloak");
|
2020-08-06 08:51:35 +00:00
|
|
|
});
|
2020-08-04 12:59:41 +00:00
|
|
|
return keycloak;
|
|
|
|
}
|