v1/packages/roleypoly-server/rpc/user.js

16 lines
362 B
JavaScript

// @flow
import { type AppContext } from '../Roleypoly'
import { type Context } from 'koa'
import * as secureAs from './_security'
export default ($: AppContext) => ({
getCurrentUser: secureAs.authed($, async (ctx: Context) => {
return await $.discord.getUserPartial(ctx.session.userId)
}),
isRoot: secureAs.root($, () => {
return true
})
})