Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2021-07-09 21:42:18 +02:00
parent 97f25b0283
commit 9f59589767
7 changed files with 173 additions and 6 deletions

View File

@@ -3,6 +3,26 @@ import Route from "@ioc:Adonis/Core/Route";
Route.group(() => {
Route.get('/me', 'AuthController.user').middleware('auth')
Route.post('/token', 'AuthController.createInfiniteToken')
Route.post('/login', 'AuthController.login')
Route.post('/logout', 'AuthController.logout')
Route.get('/twitter/callback', 'AuthController.twitter')
Route.get('/github/callback', 'AuthController.github')
Route.get('/google/callback', 'AuthController.google')
Route.get('/discord/callback', 'AuthController.discord')
Route.get('/twitter', async ({ally}) => {
return ally.use('twitter').redirect()
})
Route.get('/github', async ({ally}) => {
return ally.use('github').redirect()
})
Route.get('/google', async ({ally}) => {
return ally.use('google').redirect()
})
Route.get('/discord', async ({ally}) => {
return ally.use('discord').redirect()
})
}).prefix('/auth')