mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 09:59:09 +00:00
finish most of redux retrofit
This commit is contained in:
parent
52cb96baa3
commit
5899268b22
7 changed files with 64 additions and 17 deletions
|
@ -33,6 +33,11 @@ module.exports = (R, $) => {
|
|||
})
|
||||
|
||||
R.get('/api/auth/user', async ctx => {
|
||||
if (ctx.session.accessToken === undefined) {
|
||||
ctx.body = { err: 'not_logged_in' }
|
||||
ctx.status = 401
|
||||
}
|
||||
|
||||
const user = await $.discord.getUser(ctx.session.accessToken)
|
||||
ctx.session.userId = user.id
|
||||
ctx.session.avatarHash = user.avatar
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue