initial commit
This commit is contained in:
22
app/api/auth/google/route.ts
Normal file
22
app/api/auth/google/route.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { getGoogleAuthURL } from '@/lib/google-oauth'
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
try {
|
||||
const authURL = getGoogleAuthURL()
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
data: { authURL },
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Google OAuth URL generation error:', error)
|
||||
return NextResponse.json(
|
||||
{
|
||||
success: false,
|
||||
error: { message: 'Failed to generate Google auth URL', code: 'OAUTH_ERROR' },
|
||||
},
|
||||
{ status: 500 }
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user