mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-13 13:04:24 +01:00
feat: add terms acceptance timestamp tracking and migration script
This commit is contained in:
parent
299efc2ccb
commit
7b2ebe4bdd
10 changed files with 134 additions and 4 deletions
|
|
@ -26,6 +26,7 @@ const ALLOWED_USER_FIELDS = [
|
|||
'emailVerified',
|
||||
'twoFactorEnabled',
|
||||
'termsAccepted',
|
||||
'termsAcceptedAt',
|
||||
] as const;
|
||||
|
||||
type AllowedUserField = (typeof ALLOWED_USER_FIELDS)[number];
|
||||
|
|
|
|||
|
|
@ -655,6 +655,7 @@ export type TCustomConfigSpeechResponse = { [key: string]: string };
|
|||
|
||||
export type TUserTermsResponse = {
|
||||
termsAccepted: boolean;
|
||||
termsAcceptedAt: Date | string | null;
|
||||
};
|
||||
|
||||
export type TAcceptTermsResponse = {
|
||||
|
|
|
|||
|
|
@ -132,6 +132,10 @@ const userSchema = new Schema<IUser>(
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
termsAcceptedAt: {
|
||||
type: Date,
|
||||
default: null,
|
||||
},
|
||||
personalization: {
|
||||
type: {
|
||||
memories: {
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ export interface IUser extends Document {
|
|||
}>;
|
||||
expiresAt?: Date;
|
||||
termsAccepted?: boolean;
|
||||
termsAcceptedAt?: Date | null;
|
||||
personalization?: {
|
||||
memories?: boolean;
|
||||
};
|
||||
|
|
@ -68,6 +69,7 @@ export interface UpdateUserRequest {
|
|||
plugins?: string[];
|
||||
twoFactorEnabled?: boolean;
|
||||
termsAccepted?: boolean;
|
||||
termsAcceptedAt?: Date | null;
|
||||
personalization?: {
|
||||
memories?: boolean;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue