Skip to content

Commit

Permalink
chore: keycloak init updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kttkjl committed Mar 1, 2024
1 parent 981eb67 commit e867902
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/Auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ const dbRoles = {
readonly: 'readonly',
};

const keycloak = Keycloak({
const keycloak = new Keycloak({
realm: window._env_.KEYCLOAK_REALM,
clientId: window._env_.KEYCLOAK_CLIENT_ID,
url: window._env_.KEYCLOAK_URL,
realm_access: { roles: [window._env_.KEYCLOAK_ROLE] },
});

interface DecodedKBToken {
Expand All @@ -41,15 +40,13 @@ interface AuthContextState {
logout: () => void;
error: unknown | undefined;
isAuthenticating: boolean;

authenticationToken?: string;
authorizationToken?: string;
isAuthenticated?: boolean;
isAdmin?: boolean;
hasWriteAccess?: boolean;
user?: DecodedKBToken['user'];
username?: string;

}

const AuthContext = createContext<AuthContextState | undefined>(undefined);
Expand Down Expand Up @@ -213,7 +210,7 @@ const AuthenticatedRoute = (props: AuthenticatedRouteProps) => {
}

return (
<Route component={component} path={path} />
<Route Component={component} path={path} />
);
};

Expand Down

0 comments on commit e867902

Please sign in to comment.