add support for username authentication

This commit is contained in:
2022-02-22 00:43:16 -05:00
parent 2ac596b8c8
commit 66107c0523
5 changed files with 23 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ defmodule EntenduWeb.Plugs.AuthorizeLink do
else
with {:ok, user} <- get_user_from_path(conn),
%Link{recipient: recipient} = link <- Links.get_link(link_id),
true <- UserFromAuth.can_access?(recipient, user.emails) do
true <- UserFromAuth.can_access?(recipient, user) do
conn
|> assign(:link, link)
else