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

Boruta OAuth errors

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

Summary

Functions

Returns the URL to be redirected according to error format.

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

Types

@type 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
}

Functions

@spec 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
@spec 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.