1
0
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:
2022-09-29 18:41:28 +05:00
parent 375f924f45
commit f915c51b07
21 changed files with 1001 additions and 19 deletions

View File

@@ -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