mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
67
config/ally.ts
Normal file
67
config/ally.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Config source: https://git.io/JOdi5
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this config
|
||||
* file.
|
||||
*/
|
||||
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import {AllyConfig} from '@ioc:Adonis/Addons/Ally'
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Ally Config
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The `AllyConfig` relies on the `SocialProviders` interface which is
|
||||
| defined inside `contracts/ally.ts` file.
|
||||
|
|
||||
*/
|
||||
const allyConfig: AllyConfig = {
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Github driver
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
github: {
|
||||
driver: 'github',
|
||||
clientId: Env.get('GITHUB_CLIENT_ID'),
|
||||
clientSecret: Env.get('GITHUB_CLIENT_SECRET'),
|
||||
callbackUrl: `${Env.get('BASE_URL')}/auth/github/callback`,
|
||||
},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Google driver
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
google: {
|
||||
driver: 'google',
|
||||
clientId: Env.get('GOOGLE_CLIENT_ID'),
|
||||
clientSecret: Env.get('GOOGLE_CLIENT_SECRET'),
|
||||
callbackUrl: `${Env.get('BASE_URL')}/auth/google/callback`,
|
||||
},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Twitter driver
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
twitter: {
|
||||
driver: 'twitter',
|
||||
clientId: Env.get('TWITTER_CLIENT_ID'),
|
||||
clientSecret: Env.get('TWITTER_CLIENT_SECRET'),
|
||||
callbackUrl: `${Env.get('BASE_URL')}/auth/twitter/callback`,
|
||||
},
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Discord driver
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
discord: {
|
||||
driver: 'discord',
|
||||
clientId: Env.get('DISCORD_CLIENT_ID'),
|
||||
clientSecret: Env.get('DISCORD_CLIENT_SECRET'),
|
||||
callbackUrl: `${Env.get('BASE_URL')}/auth/discord/callback`,
|
||||
},
|
||||
}
|
||||
|
||||
export default allyConfig
|
||||
27
contracts/ally.ts
Normal file
27
contracts/ally.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Contract source: https://git.io/JOdiQ
|
||||
*
|
||||
* Feel free to let us know via PR, if you find something broken in this contract
|
||||
* file.
|
||||
*/
|
||||
|
||||
declare module '@ioc:Adonis/Addons/Ally' {
|
||||
interface SocialProviders {
|
||||
github: {
|
||||
config: GithubDriverConfig
|
||||
implementation: GithubDriverContract
|
||||
}
|
||||
google: {
|
||||
config: GoogleDriverConfig
|
||||
implementation: GoogleDriverContract
|
||||
}
|
||||
twitter: {
|
||||
config: TwitterDriverConfig
|
||||
implementation: TwitterDriverContract
|
||||
}
|
||||
discord: {
|
||||
config: DiscordDriverConfig
|
||||
implementation: DiscordDriverContract
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user