mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
added withOptionalAuthentication
middleware
This commit is contained in:
parent
ff5f156ed0
commit
adeb82629e
@ -1,6 +1,8 @@
|
||||
// const fileUpload = require("@nanoexpress/middleware-file-upload/cjs")()
|
||||
|
||||
export { default as withAuthentication } from "./withAuthentication"
|
||||
export { default as withOptionalAuthentication } from "./withOptionalAuthentication"
|
||||
|
||||
export { default as errorHandler } from "./errorHandler"
|
||||
export { default as hasPermissions } from "./hasPermissions"
|
||||
export { default as roles } from "./roles"
|
||||
|
@ -0,0 +1,9 @@
|
||||
import withAuthentication from "../withAuthentication"
|
||||
|
||||
export default (req, res, next) => {
|
||||
if (req.headers?.authorization) {
|
||||
withAuthentication(req, res, next)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user