Skip to content

Commit 1364cbd

Browse files
committed
example: update passport example
1 parent 4491f70 commit 1364cbd

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

examples/passport.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import * as client from 'openid-client'
2-
import { Strategy, type VerifyFunction } from 'openid-client/passport'
2+
import {
3+
Strategy,
4+
type VerifyFunction,
5+
type StrategyOptions,
6+
} from 'openid-client/passport'
37

48
import express from 'express'
59
import cookieParser from 'cookie-parser'
@@ -43,7 +47,12 @@ let verify: VerifyFunction = (tokens, verified) => {
4347
verified(null, tokens.claims())
4448
}
4549

46-
passport.use(new Strategy({ config, scope }, verify))
50+
let options: StrategyOptions = {
51+
config,
52+
scope,
53+
}
54+
55+
passport.use(new Strategy(options, verify))
4756

4857
passport.serializeUser((user: Express.User, cb) => {
4958
cb(null, user)

0 commit comments

Comments
 (0)