fix(auth): Allow accept-invite on subdomains without redirect to login
Don't redirect unauthenticated users to login when accessing public paths like /accept-invite, /verify-email, or /tenant-onboard on subdomains. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -297,7 +297,12 @@ const AppContent: React.FC = () => {
|
||||
: currentHostname;
|
||||
const isRootDomainForUnauthUser = currentHostname === baseDomain || currentHostname === 'localhost';
|
||||
|
||||
if (!isRootDomainForUnauthUser) {
|
||||
// Don't redirect for certain public paths that should work on any subdomain
|
||||
const publicPaths = ['/accept-invite', '/verify-email', '/tenant-onboard'];
|
||||
const currentPath = window.location.pathname;
|
||||
const isPublicPath = publicPaths.some(path => currentPath.startsWith(path));
|
||||
|
||||
if (!isRootDomainForUnauthUser && !isPublicPath) {
|
||||
// Redirect to root domain login (preserve port)
|
||||
const protocol = window.location.protocol;
|
||||
const port = window.location.port ? `:${window.location.port}` : '';
|
||||
|
||||
Reference in New Issue
Block a user