From 735a8dd998b2c0aebde9c96daefc7aa2c223218e Mon Sep 17 00:00:00 2001 From: href Date: Sat, 4 Sep 2021 05:41:09 +0200 Subject: matrix appservice, puppet improvements --- lib/lsg_matrix/plug.ex | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lib/lsg_matrix/plug.ex (limited to 'lib/lsg_matrix/plug.ex') diff --git a/lib/lsg_matrix/plug.ex b/lib/lsg_matrix/plug.ex new file mode 100644 index 0000000..5d5b603 --- /dev/null +++ b/lib/lsg_matrix/plug.ex @@ -0,0 +1,25 @@ +defmodule LSG.Matrix.Plug do + + defmodule Auth do + def init(state) do + state + end + + def call(conn, _) do + hs = Application.get_env(:matrix_app_service, :homeserver_token) + MatrixAppServiceWeb.AuthPlug.call(conn, hs) + end + end + + defmodule SetConfig do + def init(state) do + state + end + + def call(conn, _) do + config = Application.get_all_env(:matrix_app_service) + MatrixAppServiceWeb.SetConfigPlug.call(conn, config) + end + end + +end -- cgit v1.2.3