Log in redirects to the single external auth (Dex), custom JS adds a Sign up link to www.eom.dev/members, and a post-deploy task sets the oidc-cnr claims Dex sends (groups, preferred_username, name). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
12 lines
860 B
JavaScript
12 lines
860 B
JavaScript
/* eom.dev: sign-in goes to Dex; sign-up goes through the membership site */
|
|
(function(){var U='https://www.eom.dev/members';
|
|
var LOGIN='a[href$="/login"],a[href*="/plugins/oidc-cnr/"][href*="/auth/"]';
|
|
function fix(){
|
|
document.querySelectorAll('a[href$="/signup"],a[href*="/signup?"]').forEach(function(a){a.href=U;a.addEventListener('click',function(e){e.stopImmediatePropagation();},true);});
|
|
document.querySelectorAll(LOGIN).forEach(function(a){
|
|
if(a.dataset.eomSignup||a.closest('.eom-signup'))return; a.dataset.eomSignup='1';
|
|
var s=a.cloneNode(false); s.removeAttribute('data-eom-signup'); s.href=U; s.textContent='Sign up'; s.className=(a.className||'')+' eom-signup'; s.style.marginLeft='0.5rem';
|
|
a.insertAdjacentElement('afterend',s);});
|
|
}
|
|
new MutationObserver(fix).observe(document.documentElement,{childList:true,subtree:true}); fix();})();
|