mirror of
https://github.com/sasjs/server.git
synced 2026-01-05 05:40:06 +00:00
feat: replace ID with UID
BREAKING CHANGE: remove auto incremental ids from user, group and permissions and add a virtual uid property that returns string value of documents object id
This commit is contained in:
@@ -18,7 +18,7 @@ export const authorize: RequestHandler = async (req, res, next) => {
|
||||
// no need to check for permissions when route is Public
|
||||
if (await isPublicRoute(req)) return next()
|
||||
|
||||
const dbUser = await User.findOne({ id: user.userId })
|
||||
const dbUser = await User.findOne({ _id: user.userId })
|
||||
if (!dbUser) return res.sendStatus(401)
|
||||
|
||||
const path = getPath(req)
|
||||
|
||||
Reference in New Issue
Block a user