|
|
|
@ -1,6 +1,10 @@
|
|
|
|
|
import { promisify } from 'util'; |
|
|
|
|
import { validatePassword } from 'nocodb-sdk'; |
|
|
|
|
import { OrgUserRoles } from 'nocodb-sdk'; |
|
|
|
|
import { |
|
|
|
|
AuditOperationSubTypes, |
|
|
|
|
AuditOperationTypes, |
|
|
|
|
OrgUserRoles, |
|
|
|
|
validatePassword, |
|
|
|
|
} from 'nocodb-sdk'; |
|
|
|
|
import { T } from 'nc-help'; |
|
|
|
|
import * as ejs from 'ejs'; |
|
|
|
|
import bcrypt from 'bcryptjs'; |
|
|
|
@ -120,8 +124,8 @@ export async function passwordChange(param: {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
|
op_sub_type: 'PASSWORD_CHANGE', |
|
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
|
op_sub_type: AuditOperationSubTypes.PASSWORD_CHANGE, |
|
|
|
|
user: user.email, |
|
|
|
|
description: `changed password `, |
|
|
|
|
ip: param.req?.clientIp, |
|
|
|
@ -178,8 +182,8 @@ export async function passwordForgot(param: {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
|
op_sub_type: 'PASSWORD_FORGOT', |
|
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
|
op_sub_type: AuditOperationSubTypes.PASSWORD_FORGOT, |
|
|
|
|
user: user.email, |
|
|
|
|
description: `requested for password reset `, |
|
|
|
|
ip: param.req?.clientIp, |
|
|
|
@ -254,8 +258,8 @@ export async function passwordReset(param: {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
|
op_sub_type: 'PASSWORD_RESET', |
|
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
|
op_sub_type: AuditOperationSubTypes.PASSWORD_RESET, |
|
|
|
|
user: user.email, |
|
|
|
|
description: `did reset password `, |
|
|
|
|
ip: req.clientIp, |
|
|
|
@ -286,8 +290,8 @@ export async function emailVerification(param: {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
|
op_sub_type: 'EMAIL_VERIFICATION', |
|
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
|
op_sub_type: AuditOperationSubTypes.EMAIL_VERIFICATION, |
|
|
|
|
user: user.email, |
|
|
|
|
description: `verified email `, |
|
|
|
|
ip: req.clientIp, |
|
|
|
@ -442,8 +446,8 @@ export async function signup(param: {
|
|
|
|
|
user = (param.req as any).user; |
|
|
|
|
|
|
|
|
|
await Audit.insert({ |
|
|
|
|
op_type: 'AUTHENTICATION', |
|
|
|
|
op_sub_type: 'SIGNUP', |
|
|
|
|
op_type: AuditOperationTypes.AUTHENTICATION, |
|
|
|
|
op_sub_type: AuditOperationSubTypes.SIGNUP, |
|
|
|
|
user: user.email, |
|
|
|
|
description: `signed up `, |
|
|
|
|
ip: (param.req as any).clientIp, |
|
|
|
|