Pleroma v1.1.9-10-g42f76306+dev Pleroma.Web.OAuth.Token View Source

Link to this section Summary

Link to this section Types

Link to this type

t()

View Source
t() :: %Pleroma.Web.OAuth.Token{
  __meta__: term(),
  app: term(),
  app_id: term(),
  id: term(),
  inserted_at: term(),
  refresh_token: term(),
  scopes: term(),
  token: term(),
  updated_at: term(),
  user: term(),
  user_id: term(),
  valid_until: term()
}

Link to this section Functions

Link to this function

create_token(app, user, attrs \\ %{})

View Source
create_token(Pleroma.Web.OAuth.App.t(), Pleroma.User.t(), map()) ::
  {:ok, Pleroma.Web.OAuth.Token} | {:error, Changeset.t()}
Link to this function

delete_user_token(user, token_id)

View Source
Link to this function

delete_user_tokens(user)

View Source
Link to this function

exchange_token(app, auth)

View Source
exchange_token(Pleroma.Web.OAuth.App.t(), Pleroma.Web.OAuth.Authorization.t()) ::
  {:ok, Pleroma.Web.OAuth.Token.t()} | {:error, Changeset.t()}
Link to this function

get_by_refresh_token(app, token)

View Source
get_by_refresh_token(Pleroma.Web.OAuth.App.t(), String.t()) ::
  {:ok, t()} | {:error, :not_found}

Gets token for app by refresh token

Link to this function

get_by_token(app, token)

View Source
get_by_token(Pleroma.Web.OAuth.App.t(), String.t()) ::
  {:ok, t()} | {:error, :not_found}

Gets token for app by access token