cap again
This commit is contained in:
parent
2549a73d6d
commit
2702df489f
|
@ -40,7 +40,7 @@ def use_token(%Authorization{used: false, valid_until: valid_until} = auth) do
|
||||||
if NaiveDateTime.diff(NaiveDateTime.utc_now, valid_until) < 0 do
|
if NaiveDateTime.diff(NaiveDateTime.utc_now, valid_until) < 0 do
|
||||||
Repo.update(use_changeset(auth, %{used: true}))
|
Repo.update(use_changeset(auth, %{used: true}))
|
||||||
else
|
else
|
||||||
{:error, "token expired"}
|
{:error, "Token expired"}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
def use_token(%Authorization{used: true}), do: {:error, "Already used"}
|
def use_token(%Authorization{used: true}), do: {:error, "Already used"}
|
||||||
|
|
Loading…
Reference in New Issue