Skip to content

Commit ad40752

Browse files
committed
debug: add logging for Keycloak initialization
RISDEV-6773
1 parent b233244 commit ad40752

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

frontend/src/lib/auth.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ function createAuthentication() {
2121
async function configure(config: AuthenticationConfig): Promise<void> {
2222
keycloak = new Keycloak(config)
2323

24+
console.log("[auth debug] created Keycloak with config")
25+
console.log(config)
26+
console.log("[auth debug] location: ", window.location.href)
27+
2428
try {
2529
await keycloak.init({
2630
onLoad: "login-required",
2731
checkLoginIframe: false,
2832
pkceMethod: "S256",
2933
scope: "profile email",
3034
})
35+
36+
console.log("[auth debug] initialized Keycloak", keycloak)
3137
} catch (e) {
3238
keycloak = undefined
3339
throw new Error("Failed to initialize authentication", { cause: e })

frontend/src/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ try {
2828
.use(router)
2929
.use(Sentry, { environment: env.name, router })
3030

31+
console.log("[auth debug] location when creating app: ", window.location.href)
32+
console.log("[auth debug] created app")
33+
3134
// Configure authentication
3235
const auth = useAuthentication()
3336
await auth.configure({
@@ -36,8 +39,11 @@ try {
3639
realm: env.authRealm,
3740
})
3841

42+
console.log("[auth debug] configured authentication")
43+
3944
// If all initialization succeeds, mount app
4045
app.mount("#app")
46+
console.log("[auth debug] mounted app")
4147
} catch (e: unknown) {
4248
// If an error occurs above, catch it here
4349

0 commit comments

Comments
 (0)