Commit 6959fb4e authored by Mat's avatar Mat

config des nouveaux bundles

parent 6d8c62d4
......@@ -24,6 +24,8 @@ class AppKernel extends Kernel
new FOS\UserBundle\FOSUserBundle(),
new SocketBundle\SocketBundle(),
new Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle(),
new FOS\RestBundle\FOSRestBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
......
......@@ -23,7 +23,7 @@ framework:
form: ~
csrf_protection: ~
validation: { enable_annotations: true }
#serializer: { enable_annotations: true }
serializer: { enable_annotations: true, enabled: false }
default_locale: '%locale%'
trusted_hosts: ~
session:
......@@ -96,4 +96,33 @@ lexik_jwt_authentication:
secret_key: '%kernel.project_dir%/config/jwt/private.pem' # required for token creation
public_key: '%kernel.project_dir%/config/jwt/public.pem' # required for token verification
pass_phrase: '1234' # required for token creation, usage of an environment variable is recommended
token_ttl: 3600
\ No newline at end of file
token_ttl: 3600
# Nelmio CORS
nelmio_cors:
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE', 'PATCH']
max_age: 3600
# JMS serializer
jms_serializer:
handlers:
datetime:
default_format: "d/m/Y"
# FOS Rest
fos_rest:
body_converter:
enabled: true
format_listener:
rules:
path: ^/api
priorities: [json]
fallback_format: 'json'
view:
view_response_listener: true
failed_validation: HTTP_BAD_REQUEST
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment