mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-15 09:59:09 +00:00
sync
This commit is contained in:
parent
7dd7c170b4
commit
86a222fb98
20 changed files with 291 additions and 46 deletions
|
@ -49,10 +49,31 @@ module.exports = (R, $) => {
|
|||
})
|
||||
|
||||
R.get('/api/auth/redirect', ctx => {
|
||||
ctx.body = { url: $.discord.getAuthUrl() }
|
||||
const url = $.discord.getAuthUrl()
|
||||
if (ctx.query.url === '✔️') {
|
||||
ctx.body = { url }
|
||||
return
|
||||
}
|
||||
|
||||
ctx.redirect(url)
|
||||
})
|
||||
|
||||
R.post('/api/auth/logout', ctx => {
|
||||
ctx.session = null
|
||||
})
|
||||
|
||||
R.get('/api/oauth/bot', ctx => {
|
||||
const url = $.discord.getBotJoinUrl()
|
||||
if (ctx.query.url === '✔️') {
|
||||
ctx.body = { url }
|
||||
return
|
||||
}
|
||||
|
||||
ctx.redirect(url)
|
||||
})
|
||||
|
||||
|
||||
R.get('/api/oauth/bot/callback', ctx => {
|
||||
console.log(ctx.request)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue