mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
16 lines
362 B
JavaScript
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
|
|
})
|
|
|
|
})
|