add role on register
This commit is contained in:
parent
d1a366e88b
commit
9f8feb5e40
@ -3,6 +3,7 @@ import { Db } from 'mongodb'
|
||||
import { mainDb } from '../../utils/mongo'
|
||||
import { cleanId } from '../../utils/common'
|
||||
import { usersCollection } from '../../__data__/constants'
|
||||
import { Roles } from '../../model/roles'
|
||||
|
||||
export const registerUser = async ({ username, regtime, role, email, id, ...rest }) => {
|
||||
const db: Db = await mainDb
|
||||
@ -13,6 +14,7 @@ export const registerUser = async ({ username, regtime, role, email, id, ...rest
|
||||
const user = {
|
||||
...(registred || {}),
|
||||
ijlId: id,
|
||||
role: Roles.User,
|
||||
ijlUser: {
|
||||
username,
|
||||
regtime,
|
||||
|
Loading…
Reference in New Issue
Block a user