Resty v0.12.0 Resty.Auth.Bearer View Source

Authenticates by using a bearer token.

Params

The parameters are :token.

Usage

defmodule MyResource do
  use Resty.Resource.Base

  with_auth Resty.Auth.Beaer, token: "my-token"
end

You can also define a default token in your config.exs file

config :resty, Resty.Auth.Bearer, token: "my-token-from-config"

Thus making it possible to use Resty.Resource.Base.with_auth/1

defmodule MyResource do
  use Resty.Resource.Base

  with_auth Resty.Auth.Beaer
end