Skip to content

Commit

Permalink
remove ElixirAuthGoogle.generate_oauth_url/1 from page_controller as …
Browse files Browse the repository at this point in the history
…no longer used #65
  • Loading branch information
nelsonic committed Sep 30, 2020
1 parent e806ff7 commit c3259ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
13 changes: 2 additions & 11 deletions lib/app_web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@ defmodule AppWeb.PageController do
end

def index(conn, _params) do
url_oauth_google = ElixirAuthGoogle.generate_oauth_url(conn)
changeset = Person.changeset_registration(%Person{}, %{})

render(conn, "index.html",
url_oauth_google: url_oauth_google,
changeset: changeset
)
render(conn, "index.html", changeset: changeset)
end

def register(conn, %{"person" => person_params}) do
Expand All @@ -31,12 +27,7 @@ defmodule AppWeb.PageController do
create_basic_session(conn, person)

{:error, %Ecto.Changeset{} = changeset} ->
url_oauth_google = ElixirAuthGoogle.generate_oauth_url(conn)

render(conn, "index.html",
url_oauth_google: url_oauth_google,
changeset: changeset
)
render(conn, "index.html", changeset: changeset)
end
else
login(conn, person, person_params)
Expand Down
14 changes: 0 additions & 14 deletions lib/app_web/templates/page/index.html.eex
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@
<p class="f5"><strong>Unlock</strong> a new level of <strong>personal effectiveness</strong>.</p>
</section>

<section class="tc">
<!-- we don't need buttons to perform these actions the flow should be effortless.
<%=link("Capture", to: Routes.capture_path(@conn, :new),
class: "f6 b link dim br2 ph3 pv2 db white bg-dark-blue center w4 ma4") %>
<%=link("Categorise", to: Routes.categorise_path(@conn, :index), class: "f6 b link dim br2 ph3 pv2 db white bg-dark-blue center w4 ma4") %>
<%=link("Complete", to: "/", class: "f6 b link dim br2 ph3 pv2 db white bg-dark-blue center w4 ma4") %>
-->
<a href="<%= @url_oauth_google %>"> <!-- Google Auth Blue Button 8kb - we can optimise this past-MVP! -->
<img src="https://user-images.githubusercontent.com/194400/69724732-62090d80-1114-11ea-8d81-7ef4fb179f3c.png"
alt="Sign in with Google" />
</a>

</section>

<span class="b db tc pa2">OR</span>
<section class="tc">
<%= form_for @changeset, Routes.page_path(@conn, :register), fn f -> %>
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ defmodule App.MixProject do
"ecto.setup": ["ecto.create --quiet", "ecto.migrate --quiet", "seeds"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
seeds: ["run priv/repo/seeds.exs"],
test: [ "ecto.reset", "test"]
test: ["ecto.reset", "test"]
]
end
end

0 comments on commit c3259ca

Please sign in to comment.