Skip to content

Commit

Permalink
Spsh 1310 custom error template (#102)
Browse files Browse the repository at this point in the history
* DBP-1147-fix-typo (#100)

DBP-1147-fix-typo (#100)

* add logout-button to error-template

* ensure trailing slash

* make error message generic

* update error message

---------

Co-authored-by: aimee-889 <[email protected]>
  • Loading branch information
clauyan and aimee-889 authored Dec 12, 2024
1 parent bb65c72 commit 387bef8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Following steps are intent to build the container for local development purpose.
You may use a pre-build image from [`GitHub Packages`](https://github.com/orgs/hpi-schul-cloud/packages?repo_name=dbildungs-iam). To build the container on your own execute following command:

```bash
docker build --target development -t dbildungsplattform/dbildungs-iam-keycloak/dev .
docker build --load --target development -t dbildungsplattform/dbildungs-iam-keycloak/dev .
```

To create the container execute following command:
Expand Down
2 changes: 1 addition & 1 deletion charts/dbildungs-iam-keycloak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ database:
username: "dbildungs_iam_keycloak"

realm:
name: dbilduns-iam-keycloak-realm
name: dbildungs-iam-keycloak-realm
filepath: "dev-realm-spsh.json"

restartPolicy: Always
Expand Down
21 changes: 21 additions & 0 deletions src/themes/schulportal/login/error.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<#import "template.ftl" as layout>
<@layout.registrationLayout displayMessage=false; section>
<#if section = "header">
${kcSanitize(msg("errorTitle"))?no_esc}
<#elseif section = "form">
<div id="kc-error-message">
<p class="instruction">${kcSanitize(msg("loginError"))?no_esc}</p>
<form id="kc-form-logout"
<#if client?? && client.baseUrl?has_content>
action="${client.baseUrl?ensure_ends_with("/")}api/auth/logout"
<#else>
action="/realms/${realm.name}/protocol/openid-connect/logout"
</#if>
>
<div id="kc-form-buttons" class="${properties.kcFormGroupClass!}">
<input tabindex="1" class="${properties.kcButtonClass!} ${properties.kcButtonPrimaryClass!} ${properties.kcButtonBlockClass!} ${properties.kcButtonLargeClass!}" name="logout" id="kc-logout" data-testid="logout-button" type="submit" value="${msg("tryAgain")}"/>
</div>
</form>
</div>
</#if>
</@layout.registrationLayout>
2 changes: 2 additions & 0 deletions src/themes/schulportal/login/messages/messages_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ enterOldPassword=Bitte geben Sie Ihr aktuelles Passwort ein.
help=Hilfe
legalNotice=Impressum
loginAccountTitle=Anmeldung
loginError=Während Ihrer Anmeldung ist leider ein Fehler aufgetreten. Bitte versuchen Sie es erneut.<br>Sollte eine Anmeldung weiterhin nicht möglich sein, wenden Sie sich bitte an Ihre schulischen Administratorinnen und Administratoren.
tryAgain=Erneut versuchen
passwordConfirm=Neues Passwort erneut eingeben
passwordHelpText=Passwort vergessen?<br>Wenden Sie sich an Ihre schulischen Administratorinnen und Administratoren.
passwordNew=Neues Passwort eingeben
Expand Down

0 comments on commit 387bef8

Please sign in to comment.