refactor: Replicate Drop's authentication system exactly

This commit is contained in:
Usman Baig
2026-01-16 14:11:14 +01:00
parent b66f367c94
commit 0c3fd5f766
4 changed files with 53 additions and 38 deletions

View File

@@ -1,7 +1,7 @@
'use client'
import { useAuth } from '@/lib/auth/context'
import { initiateOAuthFlow } from '@/lib/api/oauth'
import { initiateOAuthFlow, initiateSignupFlow } from '@/lib/api/oauth'
import LoadingOverlay from '@/components/LoadingOverlay'
import SiteList from '@/components/sites/SiteList'
@@ -30,10 +30,7 @@ export default function HomePage() {
Sign In
</button>
<button
onClick={() => {
const authUrl = process.env.NEXT_PUBLIC_AUTH_URL || 'https://auth.ciphera.net'
window.location.href = `${authUrl}/signup?client_id=analytics-app&redirect_uri=${encodeURIComponent((process.env.NEXT_PUBLIC_APP_URL || window.location.origin) + '/auth/callback')}&response_type=code`
}}
onClick={() => initiateSignupFlow()}
className="btn-secondary"
>
Sign Up