How to combine middleware? #1226
Unanswered
alexgleason
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @alexgleason Probably it will call const auth = ({
username,
password,
authKey,
}: {
username: string
password: string
authKey: string
}): MiddlewareHandler[] => {
return [
basicAuth({
username,
password,
}),
specialAuth({ authKey }),
]
}
app.get(
'/auth/*',
...auth({
username: 'foo',
password: 'bar',
authKey: 'value',
})
) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have
basicAuth
andspecialAuth
. I prefer to keep them separate for organization, but I want to combine them into a singleauth
middleware for my router.I've gotten this far before realizing I don't know what I'm doing:
Beta Was this translation helpful? Give feedback.
All reactions