Skip to content

Commit

Permalink
Fix auth request
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprev committed Aug 29, 2023
1 parent 942a3f3 commit cb1cfc0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/accent/auth/uberauth/dummy_strategy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Accent.Auth.Ueberauth.DummyStrategy do
A username strategy for Ueberauth
"""

use Ueberauth.Strategy
use Ueberauth.Strategy, ignores_csrf_attack: true

alias Ueberauth.Auth.Credentials
alias Ueberauth.Auth.Extra
Expand Down
4 changes: 3 additions & 1 deletion lib/accent/schemas/user.ex
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ defmodule Accent.User do
"test"
iex> Accent.User.name_with_fallback(%{fullname: nil, email: "[email protected]"})
"[email protected]"
iex> Accent.User.name_with_fallback(%{fullname: "", email: "[email protected]"})
"[email protected]"
"""
def name_with_fallback(%{fullname: fullname, email: email}) when is_nil(fullname), do: email
def name_with_fallback(%{fullname: fullname, email: email}) when fullname in ["", nil], do: email
def name_with_fallback(%{fullname: fullname}), do: fullname
end
2 changes: 1 addition & 1 deletion lib/web/controllers/auth_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Accent.AuthController do
plug(Ueberauth, base_path: "/auth")

def request(conn, _params) do
render(conn, "request.html", callback_url: Helpers.callback_url(conn))
redirect(conn, to: Helpers.callback_url(conn))
end

def callback(%{assigns: %{ueberauth_auth: auth}} = conn, _) do
Expand Down
5 changes: 5 additions & 0 deletions webapp/app/pods/components/login-forms/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ a.loginButton {
border: 1px solid #888;
font-size: 13px;

&:focus {
box-shadow: 0 3px 10px var(--shadow-color);
}

&.loginButton--google {
border-color: darken(#4d90fe, 5%);
text-shadow: none;
Expand Down Expand Up @@ -169,6 +173,7 @@ a.loginButton {
&:focus,
&:hover {
background: var(--background-light);
color: var(--text-color-normal);
}
}

Expand Down

0 comments on commit cb1cfc0

Please sign in to comment.