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

Link to this section Summary

Link to this section Types

Link to this type

t()

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

Link to this section Functions

Link to this function

create_authorization(app, user, scopes \\ nil)

View Source
create_authorization(
  Pleroma.Web.OAuth.App.t(),
  Pleroma.User.t() | %{},
  [String.t()] | nil
) :: {:ok, Pleroma.Web.OAuth.Authorization.t()} | {:error, Changeset.t()}
Link to this function

create_changeset(attrs \\ %{})

View Source
create_changeset(map()) :: Changeset.t()
Link to this function

delete_by_user_query(user)

View Source
Link to this function

delete_user_authorizations(user)

View Source
delete_user_authorizations(Pleroma.User.t()) :: {integer(), any()}
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 auth for app by token

Link to this function

use_changeset(auth, params)

View Source
use_changeset(Authtorizatiton.t(), map()) :: Changeset.t()
Link to this function

use_token(auth)

View Source
use_token(Pleroma.Web.OAuth.Authorization.t()) ::
  {:ok, Pleroma.Web.OAuth.Authorization.t()}
  | {:error, Changeset.t()}
  | {:error, String.t()}