Fix: Use OAuth authorize flow, show login prompt instead of auto-redirect

This commit is contained in:
Usman Baig
2026-01-16 13:56:37 +01:00
parent 481a35b383
commit 4e9cf59828
4 changed files with 100 additions and 28 deletions

View File

@@ -7,23 +7,12 @@ const nextConfig: NextConfig = {
// * Privacy-first: Disable analytics and telemetry
productionBrowserSourceMaps: false,
async redirects() {
const authUrl = process.env.NEXT_PUBLIC_AUTH_URL || 'https://auth.ciphera.net'
return [
{
source: '/dashboard',
destination: '/',
permanent: false,
},
{
source: '/login',
destination: `${authUrl}/login?client_id=analytics-app&redirect_uri=${encodeURIComponent((process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3003') + '/auth/callback')}&response_type=code`,
permanent: false,
},
{
source: '/signup',
destination: `${authUrl}/signup?client_id=analytics-app&redirect_uri=${encodeURIComponent((process.env.NEXT_PUBLIC_APP_URL || 'http://localhost:3003') + '/auth/callback')}&response_type=code`,
permanent: false,
},
]
},
}