bug fixes, add logo, mobile styling
This commit is contained in:
@@ -28,8 +28,7 @@ defmodule EntenduWeb.AuthController do
|
||||
link = get_session(conn, :intended_link)
|
||||
|
||||
with %{id: link_id, recipient: recipient} <- link,
|
||||
{:ok, user} <- UserFromAuth.find_or_create(auth),
|
||||
true <- UserFromAuth.can_access?(recipient, user) do
|
||||
{:ok, user} <- UserFromAuth.find_or_create(auth) do
|
||||
# TODO: send over encrypted data that the frontend can decrypt
|
||||
|
||||
conn
|
||||
@@ -42,11 +41,6 @@ defmodule EntenduWeb.AuthController do
|
||||
|> put_flash(:error, "Could not find link to authenticate against")
|
||||
|> redirect(to: "/just/for/you/")
|
||||
|
||||
false ->
|
||||
conn
|
||||
|> put_flash(:error, "#{link.recipient} was not found in your list of verified emails")
|
||||
|> redirect(to: "/just/for/you/#{link.id}")
|
||||
|
||||
{:error, reason} ->
|
||||
conn
|
||||
|> put_flash(:error, reason)
|
||||
|
@@ -36,6 +36,7 @@ defmodule EntenduWeb.LinkController do
|
||||
with %Link{} = link <- Links.get_link(link_id),
|
||||
Links.update_link(link, %{recipient: recipient, service: service}) do
|
||||
conn
|
||||
|> put_session(:intended_link, %{})
|
||||
|> render("show_authorized.json", %{link: link})
|
||||
end
|
||||
end
|
||||
@@ -45,9 +46,9 @@ defmodule EntenduWeb.LinkController do
|
||||
end
|
||||
|
||||
def auth_page(conn, %{"id" => link_id}) do
|
||||
with %Link{service: service, recipient: recipient} = link <- Links.get_link(link_id) do
|
||||
with %Link{id: id, service: service, recipient: recipient} = link <- Links.get_link(link_id) do
|
||||
conn
|
||||
|> put_session(:intended_link, %{service: service, recipient: recipient})
|
||||
|> put_session(:intended_link, %{id: id, service: service, recipient: recipient})
|
||||
|> render("auth.html", %{intended_link: %{service: service, recipient: recipient}})
|
||||
end
|
||||
end
|
||||
|
@@ -6,6 +6,8 @@ defmodule EntenduWeb.PageController do
|
||||
use EntenduWeb, :controller
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, "index.html", current_user: get_session(conn, :current_user))
|
||||
conn
|
||||
|> clear_session()
|
||||
|> render("index.html")
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user