Skip to content

Google

.env
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

In your Google Cloud project, under “Authorized redirect URIs”, you need to add the callback URL.

/api/auth/google/callback

Google allows adding multiple redirect URIs, so add both your development and production URLs.

The openid, email, and profile scopes are requested by default.

auth.ts
import process from 'node:process'
import { createAuth } from '@rttnd/gau/core'
import { Google } from '@rttnd/gau/oauth';
export const auth = createAuth({
providers: [
Google({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
});