summaryrefslogtreecommitdiff
path: root/lib/matrix/plug.ex
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2022-12-20 02:19:42 +0000
committerJordan Bracco <href@random.sh>2022-12-20 19:29:41 +0100
commit9958e90eb5eb5a2cc171c40860745e95a96bd429 (patch)
treeb49cdb1d0041b9c0a81a14950d38c0203896f527 /lib/matrix/plug.ex
parentRename to Nola (diff)
Actually do not prefix folders with nola_ refs T77
Diffstat (limited to 'lib/matrix/plug.ex')
-rw-r--r--lib/matrix/plug.ex25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/matrix/plug.ex b/lib/matrix/plug.ex
new file mode 100644
index 0000000..c64ed11
--- /dev/null
+++ b/lib/matrix/plug.ex
@@ -0,0 +1,25 @@
+defmodule Nola.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