Files
desktop/CopyToKeycloak/theme/kusche-desktop/login/resources/js/desktop-register-link.js
Lars Gebhardt-Kusche 9325b93404
All checks were successful
Deploy / deploy-staging (push) Successful in 1m3s
Deploy / deploy-production (push) Has been skipped
asdasd
2026-06-15 02:05:36 +02:00

30 lines
896 B
JavaScript

(function () {
const registerLink = document.getElementById('kb-register-button');
const forgotPasswordLink = document.getElementById('kb-forgot-password-link');
if (!registerLink && !forgotPasswordLink) {
return;
}
const params = new URLSearchParams(window.location.search);
const redirectUri = params.get('redirect_uri');
if (!redirectUri) {
return;
}
try {
const target = new URL(redirectUri);
if (registerLink) {
registerLink.href = target.origin + '/auth/register/';
registerLink.hidden = false;
}
if (forgotPasswordLink) {
forgotPasswordLink.href = target.origin + '/auth/forgot-password/';
forgotPasswordLink.hidden = false;
}
} catch (error) {
console.warn('Registrierungslink konnte nicht vorbereitet werden.', error);
}
}());