[erlang] Do not export function if not defined. (#5394)

Logic added to logic_handler.mustache so that it does not export authorize_api_key/3 when the function is not defined, leading to compilation error.
This commit is contained in:
Çağdaş 2020-02-25 03:45:16 +01:00 committed by GitHub
parent 04cad77caa
commit 8f738a9b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,14 @@
-module({{packageName}}_logic_handler).
-export([handle_request/4]).
{{#authMethods}}
{{#isApiKey}}
-export([authorize_api_key/3]).
{{/isApiKey}}
{{/authMethods}}
{{^authMethods}}
-export([authorize_api_key/3]).
{{/authMethods}}
-type context() :: #{binary() => any()}.
-type handler_response() ::{
Status :: cowboy:http_status(),