mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-02-03 21:37:48 +01:00
Set OAuth providers to Stateless
This commit is contained in:
@@ -44,7 +44,7 @@ export default class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async twitter ({ ally, auth, response }: HttpContextContract) {
|
public async twitter ({ ally, auth, response }: HttpContextContract) {
|
||||||
const twitter = ally.use('twitter')
|
const twitter = ally.use('twitter').stateless()
|
||||||
|
|
||||||
if (twitter.accessDenied()) {
|
if (twitter.accessDenied()) {
|
||||||
return response.status(403).send({
|
return response.status(403).send({
|
||||||
@@ -73,7 +73,7 @@ export default class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async discord ({ ally, auth, response }: HttpContextContract) {
|
public async discord ({ ally, auth, response }: HttpContextContract) {
|
||||||
const discord = ally.use('discord')
|
const discord = ally.use('discord').stateless()
|
||||||
|
|
||||||
if (discord.accessDenied()) {
|
if (discord.accessDenied()) {
|
||||||
return response.status(403).send({
|
return response.status(403).send({
|
||||||
@@ -102,7 +102,7 @@ export default class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async github ({ ally, auth, response }: HttpContextContract) {
|
public async github ({ ally, auth, response }: HttpContextContract) {
|
||||||
const github = ally.use('github')
|
const github = ally.use('github').stateless()
|
||||||
|
|
||||||
if (github.accessDenied()) {
|
if (github.accessDenied()) {
|
||||||
return response.status(403).send({
|
return response.status(403).send({
|
||||||
@@ -131,7 +131,7 @@ export default class AuthController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async google ({ ally, auth, response, }: HttpContextContract) {
|
public async google ({ ally, auth, response, }: HttpContextContract) {
|
||||||
const google = ally.use('google')
|
const google = ally.use('google').stateless()
|
||||||
|
|
||||||
if (google.accessDenied()) {
|
if (google.accessDenied()) {
|
||||||
return response.status(403).send({
|
return response.status(403).send({
|
||||||
|
|||||||
@@ -13,16 +13,16 @@ Route.group(() => {
|
|||||||
Route.get('/discord/callback', 'AuthController.discord')
|
Route.get('/discord/callback', 'AuthController.discord')
|
||||||
|
|
||||||
Route.get('/twitter', async ({ally}) => {
|
Route.get('/twitter', async ({ally}) => {
|
||||||
return ally.use('twitter').redirect()
|
return ally.use('twitter').stateless().redirect()
|
||||||
})
|
})
|
||||||
Route.get('/github', async ({ally}) => {
|
Route.get('/github', async ({ally}) => {
|
||||||
return ally.use('github').redirect()
|
return ally.use('github').stateless().redirect()
|
||||||
})
|
})
|
||||||
Route.get('/google', async ({ally}) => {
|
Route.get('/google', async ({ally}) => {
|
||||||
return ally.use('google').redirect()
|
return ally.use('google').stateless().redirect()
|
||||||
})
|
})
|
||||||
Route.get('/discord', async ({ally}) => {
|
Route.get('/discord', async ({ally}) => {
|
||||||
return ally.use('discord').redirect()
|
return ally.use('discord').stateless().redirect()
|
||||||
})
|
})
|
||||||
}).prefix('/auth')
|
}).prefix('/auth')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user