fix module aliasing issues
This commit is contained in:
@@ -6,7 +6,7 @@ defmodule Firehose.Accounts do
|
||||
import Ecto.Query, warn: false
|
||||
alias Firehose.Repo
|
||||
|
||||
alias Firehose.Accounts.{User, UserToken, UserNotifier}
|
||||
alias Firehose.Accounts.{User, UserNotifier, UserToken}
|
||||
|
||||
## Database getters
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ defmodule Firehose.Accounts.UserNotifier do
|
||||
|
||||
import Swoosh.Email
|
||||
|
||||
alias Firehose.Mailer
|
||||
alias Firehose.Accounts.User
|
||||
alias Firehose.Mailer
|
||||
|
||||
# Delivers the email using the application mailer.
|
||||
defp deliver(recipient, subject, body) do
|
||||
|
||||
@@ -51,7 +51,12 @@
|
||||
<h2 class="text-2xl font-display font-semibold">QWAN</h2>
|
||||
<div class="space-y-4 text-lg leading-relaxed text-base-content/80">
|
||||
<p>
|
||||
I'm a partner at <a href="https://qwan.eu" class="text-primary hover:underline" target="_blank" rel="noopener">QWAN</a>,
|
||||
I'm a partner at <a
|
||||
href="https://qwan.eu"
|
||||
class="text-primary hover:underline"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
>QWAN</a>,
|
||||
where we build software based on user needs, and help others do the same, and learn together. If you're looking for collaboration, have a product you want to build, a service that needs improvement,
|
||||
or just want to nerd out about agentic systems, feel free to reach out.
|
||||
</p>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
rel="noopener"
|
||||
>QWAN</a>.
|
||||
This is where I write about agentic engineering, wishcraft, naive evals,
|
||||
and whatever prototype I'm building this week.
|
||||
and whatever prototype I'm building this week.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -251,14 +251,16 @@ defmodule FirehoseWeb.UserAuth do
|
||||
|
||||
defp mount_current_scope(socket, session) do
|
||||
Phoenix.Component.assign_new(socket, :current_scope, fn ->
|
||||
if token = session["user_token"] do
|
||||
case Accounts.get_user_by_session_token(token) do
|
||||
{user, _token_inserted_at} -> Scope.for_user(user)
|
||||
nil -> Scope.for_user(nil)
|
||||
end
|
||||
else
|
||||
Scope.for_user(nil)
|
||||
end
|
||||
scope_from_session(session)
|
||||
end)
|
||||
end
|
||||
|
||||
defp scope_from_session(%{"user_token" => token}) do
|
||||
case Accounts.get_user_by_session_token(token) do
|
||||
{user, _token_inserted_at} -> Scope.for_user(user)
|
||||
nil -> Scope.for_user(nil)
|
||||
end
|
||||
end
|
||||
|
||||
defp scope_from_session(_session), do: Scope.for_user(nil)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user