-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
I've setup Google OAuth with Lucia and storing the refresh token in the database.
I've tried to create a gmail client like so, using the stored refresh token:
export async function createGmailClient(refreshToken: string) {
const auth = new google.auth.OAuth2(clientId, clientSecret, redirectUri);
auth.setCredentials({ refresh_token: refreshToken });
return google.gmail({ version: "v1", auth });
}And then listing messages like so:
const messages = await client.users.messages.list({
userId: "me",
});But I'm getting a 400 - Precondition check failed. error which is strange to see since most reports talk about this error with service accounts.
I'm assuming that I've setup the OAuth2 client incorrectly but the error messages aren't very helpful. Any help here would be hugely appreciated.
vizath and maxdubakov
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.