Explorar o código

remove api token

reiji-h hai 1 ano
pai
achega
f978e6047f

+ 0 - 1
packages/core/src/interfaces/user.ts

@@ -14,7 +14,6 @@ export type IUser = {
   isGravatarEnabled: boolean,
   admin: boolean,
   readOnly: boolean,
-  apiToken?: string,
   isEmailPublished: boolean,
   isInvitationEmailSended: boolean,
   lang: Lang,

+ 2 - 2
packages/core/src/models/serializers/user-serializer.ts

@@ -3,7 +3,7 @@ import { Document } from 'mongoose';
 import { isPopulated, isRef, type Ref } from '../../interfaces/common';
 import type { IUser } from '../../interfaces/user';
 
-export type IUserSerializedSecurely<U extends IUser> = Omit<U, 'password' | 'apiToken' | 'email'> & { email?: string };
+export type IUserSerializedSecurely<U extends IUser> = Omit<U, 'password' | 'email'> & { email?: string };
 
 export const omitInsecureAttributes = <U extends IUser>(user: U): IUserSerializedSecurely<U> => {
 
@@ -13,7 +13,7 @@ export const omitInsecureAttributes = <U extends IUser>(user: U): IUserSerialize
 
   const {
     // eslint-disable-next-line @typescript-eslint/no-unused-vars
-    password, apiToken, email, ...rest
+    password, email, ...rest
   } = leanDoc;
 
   const secureUser: IUserSerializedSecurely<U> = rest;