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:
@@ -356,6 +356,9 @@ function schedulePush(tabName) {
|
||||
|
||||
// --- GOOGLE AUTH ROUTES ---
|
||||
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 oauth2Client = createOAuth2Client();
|
||||
const url = oauth2Client.generateAuthUrl({
|
||||
|
||||
Reference in New Issue
Block a user