diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-05 15:26:28 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-05 15:26:28 +0200 |
commit | b31d72625dd32143a45277528b90bb67a881f249 (patch) | |
tree | 7721accc994121de668933672a3d51b892e3cb77 /server/tests/fixtures | |
parent | 7a22a0a56aa75fbb1ba986a5d2c606e1343f30c2 (diff) | |
download | PeerTube-b31d72625dd32143a45277528b90bb67a881f249.tar.gz PeerTube-b31d72625dd32143a45277528b90bb67a881f249.tar.zst PeerTube-b31d72625dd32143a45277528b90bb67a881f249.zip |
Plugin user.getAuthUser is now async
So we can load the full user
Diffstat (limited to 'server/tests/fixtures')
-rw-r--r-- | server/tests/fixtures/peertube-plugin-test-four/main.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-four/main.js b/server/tests/fixtures/peertube-plugin-test-four/main.js index 6ed0c20d2..b9b207b81 100644 --- a/server/tests/fixtures/peertube-plugin-test-four/main.js +++ b/server/tests/fixtures/peertube-plugin-test-four/main.js | |||
@@ -88,8 +88,8 @@ async function register ({ | |||
88 | return res.json({ routerRoute }) | 88 | return res.json({ routerRoute }) |
89 | }) | 89 | }) |
90 | 90 | ||
91 | router.get('/user', (req, res) => { | 91 | router.get('/user', async (req, res) => { |
92 | const user = peertubeHelpers.user.getAuthUser(res) | 92 | const user = await peertubeHelpers.user.getAuthUser(res) |
93 | if (!user) return res.sendStatus(404) | 93 | if (!user) return res.sendStatus(404) |
94 | 94 | ||
95 | const isAdmin = user.role === 0 | 95 | const isAdmin = user.role === 0 |
@@ -98,6 +98,7 @@ async function register ({ | |||
98 | 98 | ||
99 | return res.json({ | 99 | return res.json({ |
100 | username: user.username, | 100 | username: user.username, |
101 | displayName: user.Account.name, | ||
101 | isAdmin, | 102 | isAdmin, |
102 | isModerator, | 103 | isModerator, |
103 | isUser | 104 | isUser |