aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/oauth/token.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/oauth/token.ex')
-rw-r--r--lib/pleroma/web/oauth/token.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/oauth/token.ex b/lib/pleroma/web/oauth/token.ex
index 2b074b470..399140003 100644
--- a/lib/pleroma/web/oauth/token.ex
+++ b/lib/pleroma/web/oauth/token.ex
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.OAuth.Token do
field(:token, :string)
field(:refresh_token, :string)
field(:scopes, {:array, :string}, default: [])
- field(:valid_until, :naive_datetime)
+ field(:valid_until, :naive_datetime_usec)
belongs_to(:user, Pleroma.User, type: Pleroma.FlakeId)
belongs_to(:app, App)
@@ -27,7 +27,7 @@ defmodule Pleroma.Web.OAuth.Token do
def exchange_token(app, auth) do
with {:ok, auth} <- Authorization.use_token(auth),
true <- auth.app_id == app.id do
- create_token(app, Repo.get(User, auth.user_id), auth.scopes)
+ create_token(app, User.get_cached_by_id(auth.user_id), auth.scopes)
end
end