Skip to content

Commit

Permalink
chore: hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
brunotot committed Nov 26, 2024
1 parent 2c44f7c commit 08dec0a
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 08dec0a

Please sign in to comment.