feat(config): add generic cookie options

This commit is contained in:
Harminder Virk 2018-10-01 20:25:08 +02:00
parent b95abf4364
commit 428f49c801

View File

@ -4,6 +4,20 @@
const Env = use('Env') const Env = use('Env')
module.exports = { module.exports = {
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application and can used when you
| need to place the application's name in a email, view or
| other location.
|
*/
name: Env.get('APP_NAME', 'AdonisJs'),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| App Key | App Key
@ -13,7 +27,7 @@ module.exports = {
| to encrypted cookies, sessions and other sensitive data. | to encrypted cookies, sessions and other sensitive data.
| |
*/ */
appKey: Env.get('APP_KEY'), appKey: Env.getOrFail('APP_KEY'),
http: { http: {
/* /*
@ -68,6 +82,7 @@ module.exports = {
*/ */
jsonpCallback: 'callback', jsonpCallback: 'callback',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Etag | Etag
@ -207,5 +222,22 @@ module.exports = {
filename: 'adonis.log', filename: 'adonis.log',
level: 'info' level: 'info'
} }
},
/*
|--------------------------------------------------------------------------
| Generic Cookie Options
|--------------------------------------------------------------------------
|
| The following cookie options are generic settings used by AdonisJs to create
| cookies. However, some parts of the application like `sessions` can have
| seperate settings for cookies inside `config/session.js`.
|
*/
cookie: {
httpOnly: true,
sameSite: false,
path: '/',
maxAge: 7200
} }
} }