diff --git a/internal/api/ui/login/static/resources/scripts/go_back.js b/internal/api/ui/login/static/resources/scripts/go_back.js new file mode 100644 index 0000000000..6755145765 --- /dev/null +++ b/internal/api/ui/login/static/resources/scripts/go_back.js @@ -0,0 +1,12 @@ +document.getElementById("back-button").addEventListener("click", goBack); +document.getElementById("back-button").style.visibility = wereInUserSelection() + ? "visible" + : "hidden"; + +function goBack() { + history.back(); +} + +function wereInUserSelection() { + return window.location.href.includes("userselection"); +} diff --git a/internal/api/ui/login/static/templates/login.html b/internal/api/ui/login/static/templates/login.html index 33c81a005e..a8e0626eb4 100644 --- a/internal/api/ui/login/static/templates/login.html +++ b/internal/api/ui/login/static/templates/login.html @@ -33,6 +33,9 @@ {{template "error-message" .}}