This commit is contained in:
Henry Jameson 2026-11-09 16:51:09 +02:00
commit 4baafe313d
3 changed files with 3 additions and 11 deletions

View file

@ -99,16 +99,9 @@ defmodule Pleroma.Web.OAuth.Token do
@spec update_activity(Token.t()) :: {:ok, Token.t()} | {:error, Ecto.Changeset.t()}
def update_activity(token) do
last_active = NaiveDateTime.utc_now()
changeset = Ecto.Changeset.change(token)
changeset
|> change(%{last_active: last_active})
|> validate_required([:last_active])
|> Repo.insert()
{:ok, token}
token
|> Ecto.Changeset.change(last_active: NaiveDateTime.utc_now())
|> Repo.update()
end
@spec create(App.t(), User.t(), map()) :: {:ok, Token.t()} | {:error, Ecto.Changeset.t()}