Update to v5

This commit is contained in:
2021-05-05 19:12:31 +02:00
parent a1a7fce36f
commit a4d033195a
17 changed files with 1941 additions and 887 deletions

View File

@@ -1,5 +1,5 @@
/**
* Config source: https://git.io/JvyKy
* Config source: https://git.io/JY0mp
*
* Feel free to let us know via PR, if you find something broken in this config
* file.
@@ -17,69 +17,8 @@ import { AuthConfig } from '@ioc:Adonis/Addons/Auth'
|
*/
const authConfig: AuthConfig = {
guard: 'web',
list: {
/*
|--------------------------------------------------------------------------
| Web Guard
|--------------------------------------------------------------------------
|
| Web guard uses classic old school sessions for authenticating users.
| If you are building a standard web application, it is recommended to
| use web guard with session driver
|
*/
web: {
driver: 'session',
provider: {
/*
|--------------------------------------------------------------------------
| Driver
|--------------------------------------------------------------------------
|
| Name of the driver
|
*/
driver: 'lucid',
/*
|--------------------------------------------------------------------------
| Identifier key
|--------------------------------------------------------------------------
|
| The identifier key is the unique key on the model. In most cases specifying
| the primary key is the right choice.
|
*/
identifierKey: 'id',
/*
|--------------------------------------------------------------------------
| Uids
|--------------------------------------------------------------------------
|
| Uids are used to search a user against one of the mentioned columns. During
| login, the auth module will search the user mentioned value against one
| of the mentioned columns to find their user record.
|
*/
uids: ['email'],
/*
|--------------------------------------------------------------------------
| Model
|--------------------------------------------------------------------------
|
| The model to use for fetching or finding users. The model is imported
| lazily since the config files are read way earlier in the lifecycle
| of booting the app and the models may not be in a usable state at
| that time.
|
*/
model: () => import('App/Models/User'),
},
},
guard: 'api',
guards: {
/*
|--------------------------------------------------------------------------
| OAT Guard
@@ -113,6 +52,7 @@ const authConfig: AuthConfig = {
|
*/
tokenProvider: {
type: 'api',
driver: 'redis',
redisConnection: 'local',
foreignKey: 'user_id',

View File

@@ -18,7 +18,7 @@ const mailConfig: MailConfig = {
| a mailer
|
*/
mailer: 'smtp',
mailer: 'mailgun',
/*
|--------------------------------------------------------------------------
@@ -36,21 +36,16 @@ const mailConfig: MailConfig = {
mailers: {
/*
|--------------------------------------------------------------------------
| Smtp
| Mailgun
|--------------------------------------------------------------------------
|
| Uses SMTP protocol for sending email
| Uses Mailgun service for sending emails.
|
*/
smtp: {
driver: 'smtp',
host: Env.get('SMTP_HOST'),
port: Env.get('SMTP_PORT'),
auth: {
user: Env.get('SMTP_USERNAME'),
pass: Env.get('SMTP_PASSWORD'),
type: 'login',
}
mailgun: {
driver: 'mailgun',
baseUrl: `https://api.mailgun.net/v3/${Env.get('MAILGUN_URL')}`,
key: Env.get('MAILGUN_API_KEY'),
},
},