diff options
Diffstat (limited to 'lib/matrix_app_service_web/controllers/v1/user_controller.ex')
-rw-r--r-- | lib/matrix_app_service_web/controllers/v1/user_controller.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/matrix_app_service_web/controllers/v1/user_controller.ex b/lib/matrix_app_service_web/controllers/v1/user_controller.ex index bf3aa1e..a6e84c0 100644 --- a/lib/matrix_app_service_web/controllers/v1/user_controller.ex +++ b/lib/matrix_app_service_web/controllers/v1/user_controller.ex @@ -8,7 +8,10 @@ defmodule MatrixAppServiceWeb.V1.UserController do https://matrix.org/docs/spec/application_service/r0.1.2#get-matrix-app-v1-users-userid """ def query(conn, %{"user_id" => user_id}) do - adapter = Application.fetch_env!(:matrix_app_service, :user_adapter) + adapter = + conn.private[:user_adapter] || + MatrixAppServiceWeb.Endpoint.config(:user_adapter) || + raise "MatrixAppService: config key user_adapter missing" with :ok <- adapter.query_user(user_id) do conn |