aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/plugins/plugin-helpers-builder.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/plugins/plugin-helpers-builder.ts')
-rw-r--r--server/lib/plugins/plugin-helpers-builder.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/plugins/plugin-helpers-builder.ts b/server/lib/plugins/plugin-helpers-builder.ts
index b76c0a8a4..4e799b3d4 100644
--- a/server/lib/plugins/plugin-helpers-builder.ts
+++ b/server/lib/plugins/plugin-helpers-builder.ts
@@ -220,6 +220,10 @@ function buildPluginRelatedHelpers (plugin: MPlugin, npmName: string) {
220 220
221function buildUserHelpers () { 221function buildUserHelpers () {
222 return { 222 return {
223 loadById: (id: number) => {
224 return UserModel.loadByIdFull(id)
225 },
226
223 getAuthUser: (res: express.Response) => { 227 getAuthUser: (res: express.Response) => {
224 const user = res.locals.oauth?.token?.User 228 const user = res.locals.oauth?.token?.User
225 if (!user) return undefined 229 if (!user) return undefined