Merge branch 'master' into master

This commit is contained in:
Evan Owens 2018-03-23 13:45:52 -04:00 committed by GitHub
commit 7e75679094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 65 additions and 36 deletions

View File

@ -157,6 +157,32 @@ $.ajax({
});
```
## User Object In Strapi Context
The User object is available to successfully authenticated requests.
#### Usage
- The authenticated `user` object is a property of `ctx.state`.
```js
create: async (ctx) => {
const { _id } = ctx.state.user
const depositObj = {
...ctx.request.body,
depositor: _id
}
const data = await strapi.services.deposit.add(depositObj);
// Send 201 `created`
ctx.created(data);
}
```
## Email templates
[See the documentation on GitHub](https://github.com/strapi/strapi/blob/master/packages/strapi-plugin-users-permissions/docs/email-templates.md)

View File

@ -1,3 +1,3 @@
{
"myCustomConfiguration": "This configuration is accessible through strapi.config.environments.development.myCustomConfiguration"
"myCustomConfiguration": "This configuration is accessible through strapi.config.environments.production.myCustomConfiguration"
}

View File

@ -8,7 +8,7 @@
"uri": "${process.env.DATABASE_URI || ''}",
"host": "${process.env.DATABASE_HOST || '127.0.0.1'}",
"port": "${process.env.DATABASE_PORT || 27017}",
"database": "${process.env.DATABASE_NAME || 'production'}",
"database": "${process.env.DATABASE_NAME || 'strapi-production'}",
"username": "${process.env.DATABASE_USERNAME || ''}",
"password": "${process.env.DATABASE_PASSWORD || ''}",
"ssl": "${process.env.DATABASE_SSL || false}",

View File

@ -1,3 +1,3 @@
{
"myCustomConfiguration": "This configuration is accessible through strapi.config.environments.development.myCustomConfiguration"
"myCustomConfiguration": "This configuration is accessible through strapi.config.environments.staging.myCustomConfiguration"
}

View File

@ -0,0 +1,20 @@
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-mongoose",
"settings": {
"client": "mongo",
"uri": "${process.env.DATABASE_URI || ''}",
"host": "${process.env.DATABASE_HOST || '127.0.0.1'}",
"port": "${process.env.DATABASE_PORT || 27017}",
"database": "${process.env.DATABASE_NAME || 'strapi-staging'}",
"username": "${process.env.DATABASE_USERNAME || ''}",
"password": "${process.env.DATABASE_PASSWORD || ''}",
"ssl": "${process.env.DATABASE_SSL || false}",
"authenticationDatabase": "${process.env.DATABASE_AUTHENTICATION_DATABASE || ''}"
},
"options": {}
}
}
}

View File

@ -1,6 +1,6 @@
{
"gzip": {
"enabled": false
"enabled": true
},
"responseTime": {
"enabled": false

View File

@ -1,35 +1,37 @@
{
"csrf": {
"enabled": false,
"enabled": true,
"key": "_csrf",
"secret": "_csrfSecret"
},
"csp": {
"enabled": false,
"policy": {
"default-src": "'self'"
}
"enabled": true,
"policy": [{
"img-src": "'self' http:"
},
"block-all-mixed-content"
]
},
"p3p": {
"enabled": false,
"enabled": true,
"value": ""
},
"hsts": {
"enabled": false,
"enabled": true,
"maxAge": 31536000,
"includeSubDomains": true
},
"xframe": {
"enabled": false,
"enabled": true,
"value": "SAMEORIGIN"
},
"xss": {
"enabled": false,
"enabled": true,
"mode": "block"
},
"cors": {
"enabled": false,
"origin": "http://localhost",
"enabled": true,
"origin": "*",
"expose": [
"WWW-Authenticate",
"Server-Authorization"

View File

@ -1,8 +1,8 @@
{
"host": "127.0.0.1",
"port": 1337,
"port": "${process.env.PORT || 1337}",
"autoReload": {
"enabled": true
"enabled": false
},
"cron": {
"enabled": false

View File

@ -1,19 +0,0 @@
{
"defaultConnection": "default",
"connections": {
"default": {
"connector": "strapi-mongoose",
"settings": {
"client": "mongo",
"host": "127.0.0.1",
"port": 27017,
"database": "test",
"username": "",
"password": "",
"ssl": false,
"authenticationDatabase": ""
},
"options": {}
}
}
}