From 027ea84fbc4f799e3a441899959e4ae52a0a4042 Mon Sep 17 00:00:00 2001 From: sennui Date: Thu, 7 May 2020 14:45:38 +0200 Subject: [PATCH] allow using token rewritten from any path --- apps/roster/src/protocol/micro_auth.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/roster/src/protocol/micro_auth.erl b/apps/roster/src/protocol/micro_auth.erl index 476d6ff51..e97661e8f 100644 --- a/apps/roster/src/protocol/micro_auth.erl +++ b/apps/roster/src/protocol/micro_auth.erl @@ -166,8 +166,8 @@ get_token(Headers) -> ?EMPTY_TOKEN -> case proplists:get_value("x-envoy-original-path", Headers, ?EMPTY_TOKEN) of %% If empty, try getting tokens from params headers ?EMPTY_TOKEN -> ?EMPTY_TOKEN; - Params -> - <<"/mqtts?access_token=", Jwt/binary>> = list_to_binary(Params), %% Parse the token from the params + Params -> + [_PathPart, <<"access_token=", Jwt/binary>>] = binary:split(list_to_binary(Params), <<"?">>), %% Parse the token from the params Jwt end; Jwt -> list_to_binary(Jwt) -- GitLab