mirror of
https://github.com/docmost/docmost.git
synced 2026-05-15 21:24:09 +08:00
feat: user deactivation
This commit is contained in:
@@ -15,6 +15,8 @@ export const AuditEvent = {
|
||||
USER_PASSWORD_CHANGED: 'user.password_changed',
|
||||
USER_PASSWORD_RESET: 'user.password_reset',
|
||||
USER_UPDATED: 'user.updated',
|
||||
USER_DEACTIVATED: 'user.deactivated',
|
||||
USER_ACTIVATED: 'user.activated',
|
||||
|
||||
// API Keys
|
||||
API_KEY_CREATED: 'api_key.created',
|
||||
|
||||
@@ -144,6 +144,13 @@ export function diffAuditTrackedFields(
|
||||
return hasChanges ? { before: beforeDiff, after: afterDiff } : null;
|
||||
}
|
||||
|
||||
export function isUserDisabled(user: {
|
||||
deactivatedAt?: Date | null;
|
||||
deletedAt?: Date | null;
|
||||
}): boolean {
|
||||
return !!(user.deactivatedAt || user.deletedAt);
|
||||
}
|
||||
|
||||
export function createByteCountingStream(source: Readable) {
|
||||
let bytesRead = 0;
|
||||
const stream = new Transform({
|
||||
|
||||
Reference in New Issue
Block a user