Add support for Api key in cookie for Symfony (#884)

This commit is contained in:
Matiss 2018-08-24 03:53:25 +02:00 committed by William Cheng
parent 79dacb20a0
commit 219a88e9c6

View File

@ -87,6 +87,10 @@ class {{controllerName}} extends Controller
// Set key with prefix in query string
$security{{name}} = $request->query->get('{{keyParamName}}');
{{/isKeyInQuery}}
{{#isKeyInCookie}}
// Set key with prefix in cookies
$security{{name}} = $request->cookies->get('{{keyParamName}}');
{{/isKeyInCookie}}
{{/isApiKey}}
{{#isBasic}}
// HTTP basic authentication required