1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-09 07:20:05 +00:00

fix: DB names updates + refresh api is added

This commit is contained in:
Saad Jutt
2021-11-03 15:56:58 +05:00
parent 46c5a75ac4
commit 9f17b17e31
18 changed files with 274 additions and 209 deletions

View File

@@ -1,10 +1,10 @@
import User from '../model/User'
export const removeTokensInDB = async (username: string, client_id: string) => {
export const removeTokensInDB = async (username: string, clientId: string) => {
const user = await User.findOne({ username })
const tokenObjIndex = user.tokens.findIndex(
(tokenObj: any) => tokenObj.clientid === client_id
(tokenObj: any) => tokenObj.clientId === clientId
)
if (tokenObjIndex > -1) {