Skip to content

Commit

Permalink
example: update passport example
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 19, 2025
1 parent 4491f70 commit 1364cbd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/passport.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import * as client from 'openid-client'
import { Strategy, type VerifyFunction } from 'openid-client/passport'
import {
Strategy,
type VerifyFunction,
type StrategyOptions,
} from 'openid-client/passport'

import express from 'express'
import cookieParser from 'cookie-parser'
Expand Down Expand Up @@ -43,7 +47,12 @@ let verify: VerifyFunction = (tokens, verified) => {
verified(null, tokens.claims())
}

passport.use(new Strategy({ config, scope }, verify))
let options: StrategyOptions = {
config,
scope,
}

passport.use(new Strategy(options, verify))

passport.serializeUser((user: Express.User, cb) => {
cb(null, user)
Expand Down

0 comments on commit 1364cbd

Please sign in to comment.