summaryrefslogtreecommitdiff
path: root/lib/matrix_app_service_web/auth_plug.ex
diff options
context:
space:
mode:
authorPierre de Lacroix <pierre@pdelacroix.com>2020-12-26 13:59:27 +0000
committerPierre de Lacroix <pierre@pdelacroix.com>2020-12-26 13:59:27 +0000
commit006b2c12cf658ea71ea2e0c4ca105041c2834569 (patch)
treed3c24da6782f80c4043ba5f59241107f73850b1e /lib/matrix_app_service_web/auth_plug.ex
parentallow runtime configuration of homserver token (diff)
parentImprove CI (diff)
Merge branch '8-improve-ci' into 'master'
Improve CI Closes #8. - change image to `bitwalker/alpine-elixir:1.10.4` - 5 stages, 2 sequences in parallel: 1 cache for dev, 1 for test - 2 artifacts for reports - 1 artifact for dialyzer PLT (cache as artifact so that it still caches on fail) See merge request kazarma/matrix_app_service.ex!9
Diffstat (limited to 'lib/matrix_app_service_web/auth_plug.ex')
-rw-r--r--lib/matrix_app_service_web/auth_plug.ex6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/matrix_app_service_web/auth_plug.ex b/lib/matrix_app_service_web/auth_plug.ex
index be38fb0..ee431aa 100644
--- a/lib/matrix_app_service_web/auth_plug.ex
+++ b/lib/matrix_app_service_web/auth_plug.ex
@@ -17,11 +17,13 @@ defmodule MatrixAppServiceWeb.AuthPlug do
@doc false
@impl Plug
- def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token) when is_binary(homeserver_token) do
+ def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token)
+ when is_binary(homeserver_token) do
verify_access_token(conn, homeserver_token)
end
- def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token) when is_function(homeserver_token, 0) do
+ def call(%Plug.Conn{params: %{"access_token" => access_token}} = conn, homeserver_token)
+ when is_function(homeserver_token, 0) do
verify_access_token(conn, homeserver_token.())
end