fix(sync): 403 insufficientPermissions -> scope youtube complet + invite reconnect
This commit is contained in:
@@ -681,6 +681,10 @@ r.get('/oauth/google/watchlater', authMiddlewareCookieAware, oauthLimiter, async
|
||||
} catch (error) {
|
||||
const out = { error: error?.message || 'watchlater_fetch_failed' };
|
||||
if (error?.hint) out.hint = error.hint;
|
||||
if (error?.ytReason) out.ytReason = error.ytReason;
|
||||
if (!out.hint && String(error?.ytReason || '').toLowerCase().includes('insufficientpermissions')) {
|
||||
out.hint = 'Scope manquant : déconnectez puis reconnectez Google pour autoriser l’accès complet YouTube.';
|
||||
}
|
||||
return res.status(error?.status || 502).json(out);
|
||||
}
|
||||
});
|
||||
@@ -719,6 +723,8 @@ r.get('/oauth/google/yt-history', authMiddlewareCookieAware, oauthLimiter, async
|
||||
if (error?.ytReason) out.ytReason = error.ytReason;
|
||||
if (error?.status === 401) {
|
||||
out.hint = 'Session Google expirée : déconnectez puis reconnectez Google.';
|
||||
} else if (String(error?.ytReason || '').toLowerCase().includes('insufficientpermissions')) {
|
||||
out.hint = 'Scope manquant : déconnectez puis reconnectez Google pour autoriser l’accès complet YouTube.';
|
||||
}
|
||||
return res.status(error?.status || 502).json(out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user