23 lines
568 B
TypeScript
23 lines
568 B
TypeScript
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 }
|
|
)
|
|
}
|
|
}
|