mirror of
https://github.com/sasjs/server.git
synced 2026-01-04 21:30:05 +00:00
feat: implemented LDAP authentication
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import mongoose, { Schema, model, Document, Model } from 'mongoose'
|
||||
const AutoIncrement = require('mongoose-sequence')(mongoose)
|
||||
import bcrypt from 'bcryptjs'
|
||||
import { AuthProviderType } from '../utils'
|
||||
|
||||
export interface UserPayload {
|
||||
/**
|
||||
@@ -17,6 +18,11 @@ export interface UserPayload {
|
||||
* Password for user
|
||||
*/
|
||||
password: string
|
||||
/**
|
||||
* Identifies the source from which user is created
|
||||
* @example "internal"
|
||||
*/
|
||||
authProvider?: AuthProviderType
|
||||
/**
|
||||
* Account should be admin or not, defaults to false
|
||||
* @example "false"
|
||||
@@ -67,6 +73,11 @@ const userSchema = new Schema<IUserDocument>({
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
authProvider: {
|
||||
type: String,
|
||||
enum: AuthProviderType,
|
||||
default: 'internal'
|
||||
},
|
||||
isAdmin: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
|
||||
Reference in New Issue
Block a user