From 4a846803e8a70c50e94993d13d7bd036696dad6d Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 21 Aug 2023 15:38:41 -0400 Subject: [PATCH] fix: improper SSO format (regression), update openapi schema --- public/openapi/components/schemas/UserObject.yaml | 15 --------------- public/openapi/read/user/userslug/edit.yaml | 15 +++++++++++++++ src/controllers/accounts/edit.js | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/public/openapi/components/schemas/UserObject.yaml b/public/openapi/components/schemas/UserObject.yaml index d10acf63bc..c2b3177637 100644 --- a/public/openapi/components/schemas/UserObject.yaml +++ b/public/openapi/components/schemas/UserObject.yaml @@ -512,21 +512,6 @@ UserObjectFull: - name - visibility - public - sso: - type: array - items: - type: object - properties: - associated: - type: boolean - url: - type: string - name: - type: string - icon: - type: string - deauthUrl: - type: string websiteLink: type: string websiteName: diff --git a/public/openapi/read/user/userslug/edit.yaml b/public/openapi/read/user/userslug/edit.yaml index 734ea32abf..8ba486b5e8 100644 --- a/public/openapi/read/user/userslug/edit.yaml +++ b/public/openapi/read/user/userslug/edit.yaml @@ -47,6 +47,21 @@ get: type: number defaultAvatar: type: string + sso: + type: array + items: + type: object + properties: + associated: + type: boolean + url: + type: string + name: + type: string + icon: + type: string + deauthUrl: + type: string groupSelectSize: type: number title: diff --git a/src/controllers/accounts/edit.js b/src/controllers/accounts/edit.js index 545d2b6392..fd346f7b61 100644 --- a/src/controllers/accounts/edit.js +++ b/src/controllers/accounts/edit.js @@ -42,7 +42,8 @@ editController.get = async function (req, res) { payload.sso = []; if (req.uid === res.locals.uid || canManageUsers) { - payload.sso = await plugins.hooks.fire('filter:auth.list', { uid: res.locals.uid, associations: [] }); + const { associations } = await plugins.hooks.fire('filter:auth.list', { uid: res.locals.uid, associations: [] }); + payload.sso = associations; } if (!allowMultipleBadges) {