Skip to content

Commit

Permalink
chore: import keycloak-js
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Dec 27, 2024
1 parent 2e0c5e8 commit c0da0da
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
27 changes: 25 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# upstream
CI_BUILD_TAG ?= lagoon-ui
CORE_REPO=https://github.com/uselagoon/lagoon.git
CORE_TREEISH=main
CORE_TREEISH=keycloak-26
CYPRESS_BASE=cypress/base:20.13.1

LAGOON_CORE_IMAGE_REPO=testlagoon
Expand All @@ -15,6 +15,15 @@ yarn-start-ui:
&& yarn build \
&& yarn start \

.PHONY: start
start:
export GRAPHQL_API=http://localhost:3000/graphql \
&& export KEYCLOAK_API=http://localhost:8088/auth \
&& export NODE_ENV=production \
&& export NODE_PORT=3003 \
&& export LAGOON_UI_TOURS_ENABLED=disabled \
&& docker compose -p $(CI_BUILD_TAG) --compatibility up --build -d ui

# run-cypress:
.PHONY: start-ui
start-ui: development-api
Expand Down Expand Up @@ -59,4 +68,18 @@ development-api-down:
.PHONY: down
down:
$(MAKE) development-api-down
docker compose -p $(CI_BUILD_TAG) --compatibility down -v --remove-orphans
docker compose -p $(CI_BUILD_TAG) --compatibility down -v --remove-orphans

.PHONY: local-dev-yarn
local-dev-yarn:
$(MAKE) local-dev-yarn-stop
docker run --name local-dev-yarn -d -v ${PWD}:/app uselagoon/node-20-builder
docker exec local-dev-yarn bash -c "yarn install --frozen-lockfile"
docker exec local-dev-yarn bash -c "yarn build"
docker exec -it local-dev-yarn bash
$(MAKE) local-dev-yarn-stop

.PHONY: local-dev-yarn-stop
local-dev-yarn-stop:
docker stop local-dev-yarn || true
docker rm local-dev-yarn || true
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"graphql": "^16.8.1",
"graphql-tag": "^2.10.0",
"isomorphic-unfetch": "^4.0.2",
"keycloak-js": "^26.0.7",
"moment": "^2.22.2",
"moment-duration-format": "^2.2.2",
"next": "^14.2.2",
Expand Down
1 change: 1 addition & 0 deletions src/lib/withKeycloak.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';

import getConfig from 'next/config';

import Keycloak from 'keycloak-js';
import { queryStringToObject } from 'lib/util';

const { serverRuntimeConfig, publicRuntimeConfig } = getConfig();
Expand Down
1 change: 0 additions & 1 deletion src/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class MyDocument extends Document {
return (
<Html>
<Head>
<Script src={`${publicRuntimeConfig.KEYCLOAK_API}/js/keycloak.js`} strategy="beforeInteractive" />
<Plugins hook="head" />
</Head>
<body>
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10279,6 +10279,11 @@ jsprim@^2.0.2:
object.assign "^4.1.4"
object.values "^1.1.6"

keycloak-js@^26.0.7:
version "26.0.7"
resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-26.0.7.tgz#2025256f7c519df654240648052ea06344e2377e"
integrity sha512-vKCk1ISMiouYRLjMzi5fKp58RnYxKEBS29BoDgVfYwVW94IXchj9jLqBvIet31VD1v79l3WaWT+WMX7fH8O4wA==

keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
Expand Down

0 comments on commit c0da0da

Please sign in to comment.