Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: hotfix #38

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/app-node-express/src/lib/keycloak/KeycloakDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { env } from "@/server/env";
export class KeycloakDao {
private readonly TOKEN_MANAGER: KeycloakTokenManager;
private readonly ADMIN_API_URL: string;
private readonly KC_CLIENT_ID: string;

public static readonly KC_CLIENT_ID: string = env.KEYCLOAK_APP_CLIENT_ID;

protected ROLES: Record<string, string>;

constructor() {
const { KEYCLOAK_URL, KEYCLOAK_REALM } = env;
this.TOKEN_MANAGER = new KeycloakTokenManager();
this.ADMIN_API_URL = `${KEYCLOAK_URL}/admin/realms/${KEYCLOAK_REALM}`;
this.KC_CLIENT_ID = env.KEYCLOAK_APP_CLIENT_ID;
this.initRoles();
}

Expand Down Expand Up @@ -78,7 +78,7 @@ export class KeycloakDao {

private async initRoles() {
const res = await this.get<{ id: string; name: string }[]>(
`/clients/${this.KC_CLIENT_ID}/roles`,
`/clients/${KeycloakDao.KC_CLIENT_ID}/roles`,
);
this.ROLES = res.reduce(
(acc, role) => {
Expand Down
Loading