Create action_fallback for username/password incorrect input
This commit is contained in:
parent
103eca482c
commit
bdb5dd2194
3 changed files with 26 additions and 0 deletions
19
lib/pleroma/web/oauth/fallback_controller.ex
Normal file
19
lib/pleroma/web/oauth/fallback_controller.ex
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue