Skip to content
Discussion options

You must be logged in to vote

Hey @balazsorban44, I found the solution myself after a lot of research. I post it here if that can help somebody.

The prisma adapter is generating an Account entity, with the refreshToken and accessToken stored in it, but to use an API you have to add the good scopes to the Google Provider.

Here's an example to use create a Google event for the user:

import NextAuth from "next-auth";
import Providers from "next-auth/providers";
import Adapters from "next-auth/adapters";
import prisma from "../../../lib/prisma";

const scopes = [
  "https://www.googleapis.com/auth/calendar",
  "https://www.googleapis.com/auth/userinfo.email",
  "https://www.googleapis.com/auth/userinfo.profile",
];
const a…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@edonadei
Comment options

Comment options

You must be logged in to vote
3 replies
@balazsorban44
Comment options

@edonadei
Comment options

@balazsorban44
Comment options

Answer selected by edonadei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #2797 on September 20, 2021 06:50.