|
|
@ -10,6 +10,7 @@ defmodule BlockScoutWeb.Account.Api.V1.UserController do |
|
|
|
alias Explorer.Account.{Identity, PublicTagsRequest, TagAddress, TagTransaction, WatchlistAddress} |
|
|
|
alias Explorer.Account.{Identity, PublicTagsRequest, TagAddress, TagTransaction, WatchlistAddress} |
|
|
|
alias Explorer.ExchangeRates.Token |
|
|
|
alias Explorer.ExchangeRates.Token |
|
|
|
alias Explorer.{Market, Repo} |
|
|
|
alias Explorer.{Market, Repo} |
|
|
|
|
|
|
|
alias Plug.CSRFProtection |
|
|
|
|
|
|
|
|
|
|
|
action_fallback(BlockScoutWeb.Account.Api.V1.FallbackController) |
|
|
|
action_fallback(BlockScoutWeb.Account.Api.V1.FallbackController) |
|
|
|
|
|
|
|
|
|
|
@ -454,6 +455,14 @@ defmodule BlockScoutWeb.Account.Api.V1.UserController do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_csrf(conn, _) do |
|
|
|
|
|
|
|
with {:auth, %{id: _}} <- {:auth, current_user(conn)} do |
|
|
|
|
|
|
|
conn |
|
|
|
|
|
|
|
|> put_status(200) |
|
|
|
|
|
|
|
|> render(:csrf, %{csrf: CSRFProtection.get_csrf_token()}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
defp reject_nil_map_values(map) when is_map(map) do |
|
|
|
defp reject_nil_map_values(map) when is_map(map) do |
|
|
|
Map.reject(map, fn {_k, v} -> is_nil(v) end) |
|
|
|
Map.reject(map, fn {_k, v} -> is_nil(v) end) |
|
|
|
end |
|
|
|
end |
|
|
|