fix(oauth): set GOOGLE_REDIRECT_URI in docker-compose; guard missing credentials

- Add APP_URL and GOOGLE_REDIRECT_URI=https://scoreodonto.com/api/oauth2callback
  to docker-compose backend environment
- /api/auth/google/url returns 503 with clear message when CLIENT_ID/SECRET unset
- GoogleConnectButton shows alert instead of silently breaking on API error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
VPS 4 Builder
2026-05-14 05:52:33 +02:00
parent 63962d51c1
commit fc891ab878
2 changed files with 10 additions and 1 deletions
+7 -1
View File
@@ -14,7 +14,13 @@ export const GoogleConnectButton: React.FC<GoogleConnectButtonProps> = ({ ownerI
setIsLoading(true);
try {
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
const width = 600;