Skip to content
Discussion options

You must be logged in to vote

I would recommend following the documentation located here: https://blitzjs.com/docs/passportjs as I find passport.js to be fairly easy to use and is already supported with Blitz.

In particular with Google and Facebook you'll need developer accounts if you haven't already attained those and then follow their 0Auth app creation process. For google, this video should do the trick.

You'll need to import npm install passport-google-oauth20 as well.

This is my api/auth/[...auth].ts file:

import { passportAuth } from "blitz"
import { Strategy as GoogleStrategy } from "passport-google-oauth20"
import db from "db"

console.log("Google CLient Id: ", process.env.GOOGLE_CLIENT_ID)

export default pa…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zwl1619
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants