Merge branch 'claude/youthful-mendel-0c569f'

This commit is contained in:
VPS 4 Builder
2026-05-14 05:52:36 +02:00
2 changed files with 10 additions and 1 deletions
+3
View File
@@ -356,6 +356,9 @@ function schedulePush(tabName) {
// --- GOOGLE AUTH ROUTES --- // --- GOOGLE AUTH ROUTES ---
app.get('/api/auth/google/url', (req, res) => { app.get('/api/auth/google/url', (req, res) => {
if (!process.env.GOOGLE_CLIENT_ID || !process.env.GOOGLE_CLIENT_SECRET) {
return res.status(503).json({ error: 'GOOGLE_CLIENT_ID e GOOGLE_CLIENT_SECRET não configurados no servidor.' });
}
const { dentistId } = req.query; const { dentistId } = req.query;
const oauth2Client = createOAuth2Client(); const oauth2Client = createOAuth2Client();
const url = oauth2Client.generateAuthUrl({ const url = oauth2Client.generateAuthUrl({
+7 -1
View File
@@ -14,7 +14,13 @@ export const GoogleConnectButton: React.FC<GoogleConnectButtonProps> = ({ ownerI
setIsLoading(true); setIsLoading(true);
try { try {
const response = await fetch(`/api/auth/google/url?dentistId=${ownerId}`); const response = await fetch(`/api/auth/google/url?dentistId=${ownerId}`);
const { url } = await response.json(); const data = await response.json();
if (!response.ok || data.error) {
alert(`Erro: ${data.error || 'Falha ao obter URL de autenticação'}`);
setIsLoading(false);
return;
}
const { url } = data;
// Abrir em popup para manter o contexto // Abrir em popup para manter o contexto
const width = 600; const width = 600;