У меня есть следующий сценарий: < /p>
Пользовательский входит через Google Auth с базовыми областями < /p>
< /li>
После того, как он входит /> После разрешения предоставленного я сохраняю токен обновления в базе данных. Даже это не должно. const clientGoogle = window.google.accounts.oauth2.initCodeClient({
client_id: CLIENT_ID,
scope: 'email profile openid',
redirect_uri: redirectUri,
callback: handleGoogleResponse,
ux_mode: 'redirect',
select_account: true,
include_granted_scopes: true,
//access_type: 'offline'//no need offline access, because no need the refresh token
});
< /code>
и здесь инициализация Google для части календаря: < /p>
const clientGoogle = window.google.accounts.oauth2.initCodeClient({
client_id: CLIENT_ID,
scope: 'https://www.googleapis.com/auth/calendar',
redirect_uri: redirectUri, // Use dynamic origin instead of hardcoded URL
callback: handleGoogleResponse,
access_type: 'offline',
include_granted_scopes: true, // Enable incremental authorization
select_account: true,
login_hint: user?.user?.email,
prompt: 'consent',
response_type: 'code',
});
Подробнее здесь: https://stackoverflow.com/questions/797 ... in-consent