View Source Boruta.Oauth.Error (Boruta core v2.1.5)

Boruta OAuth errors

Note: Intended to follow OAuth 2.0 errors. Additionnal errors are provided as purpose.

Link to this section Summary

Functions

Returns the URL to be redirected according to error format.

Returns the OAuth error augmented with the format according to request type.

Link to this section Types

Specs

t() :: %Boruta.Oauth.Error{
  error:
    :invalid_request
    | :invalid_client
    | :invalid_access_token
    | :invalid_scope
    | :invalid_code
    | :invalid_resource_owner
    | :login_required
    | :unknown_error,
  error_description: String.t(),
  format: :query | :fragment | nil,
  redirect_uri: String.t() | nil,
  state: String.t() | nil,
  status: :internal_server_error | :bad_request | :unauthorized
}

Link to this section Functions

Specs

redirect_to_url(error :: t()) :: url :: String.t()

Returns the URL to be redirected according to error format.

Link to this function

with_format(error, request)

View Source

Specs

with_format(
  error :: t(),
  request ::
    Boruta.Oauth.CodeRequest.t()
    | Boruta.Oauth.TokenRequest.t()
    | Boruta.Oauth.HybridRequest.t()
) :: t()

Returns the OAuth error augmented with the format according to request type.