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

Allow users to contact support from Keycloak login page #1

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "Keycloakify Starter Devcontainer",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm",
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "none"
},
"ghcr.io/devcontainers-contrib/features/maven-sdkman:2": {
"version": "latest",
"jdkVersion": "latest",
"jdkDistro": "ms"
}
},
"postCreateCommand": "yarn install",
"customizations": {
"vscode": {
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
}
}
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# List of email addresses to present to users for contact information
CONTACT_EMAILS=dstephenson@trihydro.com,bpayne@trihydro.com
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "jpo-cvmanager"]
path = jpo-cvmanager
url = https://github.com/Trihydro/jpo-cvmanager
14 changes: 14 additions & 0 deletions src/login/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ if (result.wasPresent) {
console.log("my_custom_param", result.value);
}

var contactEmails = process.env.CONTACT_EMAILS ?? "";

export default function Login(props: PageProps<Extract<KcContext, { pageId: "login.ftl" }>, I18n>) {
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
Expand Down Expand Up @@ -204,6 +205,19 @@ export default function Login(props: PageProps<Extract<KcContext, { pageId: "log
</div>
)}
</div>
<div>
<br />
<p>Can't log in? Please contact the following individuals for support.</p>
<ul>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to do this more dynamically? IE read from environment variables or config file or something so we can swap out per environment?

{
contactEmails.split(",").map((email) => (
<li>
<a href={`mailto:${email}`}>{email}</a>
</li>
))
}
</ul>
</div>
</Template>
);
}