@instance Application.get_env(:pleroma, :instance)
def masto_instance(conn, _params) do
+ user_count = Repo.aggregate(User.local_user_query, :count, :id)
response = %{
uri: Web.base_url,
title: Keyword.get(@instance, :name),
streaming_api: String.replace(Web.base_url, ["http","https"], "wss")
},
stats: %{
- user_count: 1,
status_count: 2,
+ user_count: user_count,
domain_count: 3
- }
+ },
+ max_toot_chars: Keyword.get(@instance, :limit)
}
json(conn, response)
def login(conn, _) do
conn
- |> render(MastodonView, "login.html")
+ |> render(MastodonView, "login.html", %{error: false})
end
defp get_or_make_app() do
conn
|> put_session(:oauth_token, token.token)
|> redirect(to: "/web/getting-started")
+ else
+ _e ->
+ conn
+ |> render(MastodonView, "login.html", %{error: "Wrong username or password"})
end
end