Skip to content

Commit

Permalink
feat(key-cloak): update envs prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
morhag90 committed Sep 9, 2024
1 parent d3213dc commit 044f595
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/auth-keycloak/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplication/plugin-auth-keycloak",
"version": "0.0.9",
"version": "0.0.10",
"description": "Keycloak Authentication plugin for Amplication",
"main": "dist/index.js",
"nx": {},
Expand Down
10 changes: 5 additions & 5 deletions plugins/auth-keycloak/src/events/createAdminDotEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import { getPluginSettings } from "../utils/getPluginSettings";

export const beforeCreateAdminDotEnv = async (
context: DsgContext,
eventParams: CreateAdminDotEnvParams,
eventParams: CreateAdminDotEnvParams
): Promise<CreateAdminDotEnvParams> => {
const settings = getPluginSettings(context.pluginInstallations);

const { port, realmID, clientID } = settings;

const envVariables = {
// Keycloak
REACT_APP_KEYCLOAK_URL: `http://localhost:${port}`,
REACT_APP_KEYCLOAK_REALM: realmID,
REACT_APP_KEYCLOAK_CLIENT_ID: clientID,
VITE_REACT_APP_KEYCLOAK_URL: `http://localhost:${port}`,
VITE_REACT_APP_KEYCLOAK_REALM: realmID,
VITE_REACT_APP_KEYCLOAK_CLIENT_ID: clientID,
};

eventParams.envVariables = eventParams.envVariables.concat(
convertToVarDict(envVariables),
convertToVarDict(envVariables)
);

return eventParams;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { AuthProvider } from "react-admin";
import { jwtDecode } from "jwt-decode";

const keycloakConfig: KeycloakConfig = {
realm: process.env.REACT_APP_KEYCLOAK_REALM || "master",
url: process.env.REACT_APP_KEYCLOAK_URL || "http://localhost:8080/auth",
clientId: process.env.REACT_APP_KEYCLOAK_CLIENT_ID || "admin-ui",
realm: process.env.VITE_REACT_APP_KEYCLOAK_REALM || "master",
url: process.env.VITE_REACT_APP_KEYCLOAK_URL || "http://localhost:8080/auth",
clientId: process.env.VITE_REACT_APP_KEYCLOAK_CLIENT_ID || "admin-ui",
};

export const keycloakClient = new Keycloak(keycloakConfig);
Expand Down

0 comments on commit 044f595

Please sign in to comment.