26 lines
758 B
Elixir
26 lines
758 B
Elixir
defmodule Mv.Secrets do
|
|
use AshAuthentication.Secret
|
|
|
|
def secret_for([:authentication, :strategies, :rauthy, :client_id], Mv.Accounts.User, _opts, _meth) do
|
|
get_config(:client_id)
|
|
end
|
|
|
|
def secret_for([:authentication, :strategies, :rauthy, :redirect_uri], Mv.Accounts.User, _opts, _meth) do
|
|
get_config(:redirect_uri)
|
|
end
|
|
|
|
def secret_for([:authentication, :strategies, :rauthy, :client_secret], Mv.Accounts.User, _opts, _meth) do
|
|
get_config(:client_secret)
|
|
end
|
|
|
|
def secret_for([:authentication, :strategies, :rauthy, :base_url], Mv.Accounts.User, _opts, _meth) do
|
|
get_config(:base_url)
|
|
end
|
|
|
|
defp get_config(key) do
|
|
:mv
|
|
|> Application.fetch_env!(:rauthy)
|
|
|> Keyword.fetch!(key)
|
|
|> then(&{:ok, &1})
|
|
end
|
|
end
|