mirror of
https://github.com/sasjs/server.git
synced 2026-01-06 14:10: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:
@@ -4,7 +4,7 @@ import { RequestUser } from '../types'
|
||||
export const fetchLatestAutoExec = async (
|
||||
reqUser: RequestUser
|
||||
): Promise<RequestUser | undefined> => {
|
||||
const dbUser = await User.findOne({ id: reqUser.userId })
|
||||
const dbUser = await User.findOne({ _id: reqUser.userId })
|
||||
|
||||
if (!dbUser) return undefined
|
||||
|
||||
@@ -26,7 +26,7 @@ export const verifyTokenInDB = async (
|
||||
token: string,
|
||||
tokenType: 'accessToken' | 'refreshToken'
|
||||
): Promise<RequestUser | undefined> => {
|
||||
const dbUser = await User.findOne({ id: userId })
|
||||
const dbUser = await User.findOne({ _id: userId })
|
||||
|
||||
if (!dbUser) return undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user