--- /dev/null
+defmodule Pleroma.Web.OAuth.FallbackController do
+ use Pleroma.Web, :controller
+ alias Pleroma.Web.OAuth.OAuthController
+
+ # No user
+ def call(conn, nil) do
+ conn
+ |> put_flash(:error, "Invalid Username/Password")
+ |> OAuthController.authorize(conn.params)
+ end
+
+ # No password
+ def call(conn, false) do
+ conn
+ |> put_flash(:error, "Invalid Username/Password")
+ |> OAuthController.authorize(conn.params)
+ end
+
+end
\ No newline at end of file
alias Pleroma.{Repo, User}
alias Comeonin.Pbkdf2
+ plug :fetch_session
+ plug :fetch_flash
+
+ action_fallback Pleroma.Web.OAuth.FallbackController
+
def authorize(conn, params) do
render conn, "show.html", %{
response_type: params["response_type"],
+<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
+<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
<h2>OAuth Authorization</h2>
<%= form_for @conn, o_auth_path(@conn, :authorize), [as: "authorization"], fn f -> %>
<%= label f, :name, "Name" %>