support express v5
#12606
Replies: 1 comment
-
in fact, I've modified the source code to make it work by default export function ExpressAuth(config: ExpressAuthConfig) {
return async (req: e.Request, res: e.Response, next: e.NextFunction) => {
e.json()(req, res, async (err) => {
if (err) return next(err)
e.urlencoded({ extended: true })(req, res, async (err) => {
if (err) return next(err)
try {
// config.basePath = getBasePath(req) // 💡 setEnvDefaults will set basePath = "/auth"
setEnvDefaults(process.env, config)
await toExpressResponse(await Auth(toWebRequest(req), config), res)
if (!res.headersSent) next()
} catch (error) {
next(error)
}
})
})
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
none
Non-Goals
none
Background
none
Proposal
Beta Was this translation helpful? Give feedback.
All reactions