summaryrefslogtreecommitdiff
path: root/lib/lsg_matrix/plug.ex
diff options
context:
space:
mode:
authorhref <href@random.sh>2021-09-04 05:41:09 +0200
committerhref <href@random.sh>2021-09-04 05:41:09 +0200
commit735a8dd998b2c0aebde9c96daefc7aa2c223218e (patch)
tree4a165897c8557065dfab401455943524087f79af /lib/lsg_matrix/plug.ex
parentchat_live improvements (diff)
matrix appservice, puppet improvements
Diffstat (limited to 'lib/lsg_matrix/plug.ex')
-rw-r--r--lib/lsg_matrix/plug.ex25
1 files changed, 25 insertions, 0 deletions
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