Skip to content

Commit 3533425

Browse files
committed
server/PublicUser: update apiKeys to be sanitised api keys
1 parent 9623321 commit 3533425

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

server/types/user.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Document, Model, Types } from 'mongoose';
22
import { VirtualId, MongooseTimestamps } from './mongoose';
33
import { UserPreferences, CookieConsentOptions } from './userPreferences';
44
import { EmailConfirmationStates } from './email';
5-
import { ApiKeyDocument } from './apiKey';
5+
import { ApiKeyDocument, SanitisedApiKey } from './apiKey';
66
import { Error, GenericResponseBody, RouteParam } from './express';
77

88
// -------- MONGOOSE --------
@@ -38,14 +38,16 @@ export interface PublicUser
3838
| 'email'
3939
| 'username'
4040
| 'preferences'
41-
| 'apiKeys'
4241
| 'verified'
4342
| 'id'
4443
| 'totalSize'
4544
| 'github'
4645
| 'google'
4746
| 'cookieConsent'
48-
> {}
47+
> {
48+
/** Can contain either raw ApiKeyDocuments (server side) or SanitisedApiKeys (client side) */
49+
apiKeys: SanitisedApiKey[];
50+
}
4951

5052
/** Mongoose document object for User */
5153
export interface UserDocument

0 commit comments

Comments
 (0)