Skip to content

Commit

Permalink
fix: improper SSO format (regression), update openapi schema
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Aug 21, 2023
1 parent db15e7c commit 4a84680
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
15 changes: 0 additions & 15 deletions public/openapi/components/schemas/UserObject.yaml
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions public/openapi/read/user/userslug/edit.yaml
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion src/controllers/accounts/edit.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 4a84680

Please sign in to comment.