feat(auth): restore Google sign-in and AI admin test routes
Google OAuth was implemented locally but never deployed; the login button only renders when AUTH_GOOGLE_ID and AUTH_GOOGLE_SECRET are set. Also restores /api/ai/test-* endpoints removed by mistake and wires Google credentials into deploy workflows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -51,10 +51,19 @@ export function AI_TESTER({ type }: { type: 'tags' | 'embeddings' | 'chat' }) {
|
||||
try {
|
||||
const response = await fetch(`/api/ai/test-${type}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
|
||||
const endTime = Date.now()
|
||||
const contentType = response.headers.get('content-type') || ''
|
||||
if (!contentType.includes('application/json')) {
|
||||
const bodyPreview = (await response.text()).slice(0, 200)
|
||||
throw new Error(
|
||||
response.status === 404
|
||||
? `Route API introuvable (/api/ai/test-${type}). Redéployez l’application.`
|
||||
: `Réponse non-JSON (HTTP ${response.status}): ${bodyPreview}`,
|
||||
)
|
||||
}
|
||||
const data = await response.json()
|
||||
|
||||
setResult({
|
||||
|
||||
Reference in New Issue
Block a user