Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
bdb5dd21
Commit
bdb5dd21
authored
Feb 08, 2018
by
Calv
Browse files
Create action_fallback for username/password incorrect input
parent
103eca48
Changes
3
Show whitespace changes
Inline
Side-by-side
lib/pleroma/web/oauth/fallback_controller.ex
0 → 100644
View file @
bdb5dd21
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
lib/pleroma/web/oauth/oauth_controller.ex
View file @
bdb5dd21
...
...
@@ -5,6 +5,11 @@ defmodule Pleroma.Web.OAuth.OAuthController do
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"
],
...
...
lib/pleroma/web/templates/o_auth/o_auth/show.html.eex
View file @
bdb5dd21
<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"
%>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment