无论我做什么,我似乎都无法获得显示 Google 日历权限的同意屏幕。
我处于测试模式并且正在使用测试用户。尽管如此,我似乎还是无法弄清楚这一点。有谁知道为什么吗?
async function handleSignInWithGoogle(response) {
const nonce = await generateNonce();
const { data, error } = await supabase.auth.signInWithIdToken({
provider: 'google',
token: response.credential,
nonce: nonce,
options: {
scopes: ['openid', 'profile', 'email', 'https://www.googleapis.com/auth/calendar.readonly']
}
});
if (error) {
console.error('Error signing in:', error.message);
} else {
email = data.user?.email ?? '';
accessToken = data.session?.access_token;
console.log('Access Token:', accessToken);
}
loading = false;
}
const handleGoogleLogin = async () => {
loading = true;
const { data, error } = await supabase.auth.signInWithOAuth({
provider: 'google',
options: {
scopes: ['openid', 'profile', 'email', 'https://www.googleapis.com/auth/calendar.readonly']
}
});
if (error) {
console.error('Error signing in:', error.message);
} else {
email = data.user.email;
}
loading is false;
};