feat(server): Server.Auth.verify_password/1

This commit is contained in:
Carsten 2026-04-21 22:48:36 +02:00
parent 58f22243a5
commit 9c457c1f68
2 changed files with 44 additions and 0 deletions

16
server/lib/server/auth.ex Normal file
View file

@ -0,0 +1,16 @@
defmodule Server.Auth do
@moduledoc "Single-user dashboard authentication."
@spec verify_password(term()) :: :ok | :error
def verify_password(password) when is_binary(password) do
hash = Application.fetch_env!(:server, :dashboard_password_hash)
if Argon2.verify_pass(password, hash) do
:ok
else
:error
end
end
def verify_password(_), do: :error
end