Update viewer.tsx (#7428)

This commit is contained in:
Omar López 2023-02-27 12:39:26 -07:00 committed by GitHub
parent b9064b1f72
commit 2a98ca4b91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -455,8 +455,9 @@ const loggedInViewerRouter = router({
const { credentials } = user;
const enabledApps = await getEnabledApps(credentials);
//TODO: Refactor this to pick up only needed fields and prevent more leaking
let apps = enabledApps.map(
({ credentials: _, credential: _1 /* don't leak to frontend */, ...app }) => {
({ credentials: _, credential: _1, key: _2 /* don't leak to frontend */, ...app }) => {
const credentialIds = credentials.filter((c) => c.type === app.type).map((c) => c.id);
const invalidCredentialIds = credentials
.filter((c) => c.type === app.type && c.invalid)