From 8ed4505dc0ca24a9381c8c4b3e6aa08676f58e51 Mon Sep 17 00:00:00 2001 From: William Mantly Date: Tue, 28 Jul 2026 13:06:58 -0400 Subject: [PATCH] Explain why the user landed on the login page Landing here with ?redirect= and no explanation is exactly what happens when another app's "Log in with SSO" sends an unauthenticated user through /oauth/authorize, which bounces them here. Shows a contextual banner: a specific message when the redirect target is an OAuth authorize URL, a generic "you'll be sent back" message otherwise. Verified live for both cases (OAuth-authorize redirect and a plain redirect) against a local stack. Co-Authored-By: Claude Sonnet 5 --- nodejs/views/login.ejs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nodejs/views/login.ejs b/nodejs/views/login.ejs index f4c98d6..b3869ba 100755 --- a/nodejs/views/login.ejs +++ b/nodejs/views/login.ejs @@ -7,6 +7,22 @@ } }); + // Landing here with no explanation ("why am I on the SSO login page?") is + // exactly what happens when another app's "Log in with SSO" button sends + // an unauthenticated user through /oauth/authorize, which bounces them + // here with ?redirect=. Tell them what's happening instead of leaving it + // a mystery. + $(document).ready(function(){ + var redirect = <%- JSON.stringify(redirect || '') %>; + if(redirect){ + var isOauth = /\/oauth\/authorize/.test(redirect); + var message = isOauth + ? 'Log in to continue — an application is requesting access to your account.' + : "Log in to continue to what you were doing — you'll be sent back afterward."; + app.messages.action(message, $('.card').first(), 'info'); + } + }); + function setOtpMethod(method) { $('#otpMethodInput').val(method); $('#otpMethodEmail').toggleClass('active', method === 'email').toggleClass('btn-secondary', method === 'email').toggleClass('btn-outline-secondary', method !== 'email');