# `Rivet.Auth.Access`
[🔗](https://github.com/srevenant/rivet-ident/blob/main/lib/auth/access/index.ex#L1)

Validation of tokens for accessing site (after refresh)

Note: this is the start of the next iteration, and it will replace
Rivet.Auth.Token

# `check`

```elixir
@spec check(auth_header :: [String.t()], Rivet.Auth.Domain.t()) ::
  {:ok | :missing | :error, Rivet.Auth.Domain.t()}
```

```
iex> alias Rivet.Auth
iex> check([""], %Auth.Domain{})
{:missing, %Auth.Domain{log: "Missing authorization header value"}}
iex> check([], %Auth.Domain{})
{:missing, %Auth.Domain{log: "Missing authorization header value"}}
iex> check(["bearer token"], %Auth.Domain{})
{:error, %Auth.Domain{log: "Invalid authorization"}}
iex> check(["narf"], %Auth.Domain{})
{:error, %Auth.Domain{log: "Authorization header exists but is not formatted properly"}}
iex> check(["narf narf"], %Auth.Domain{})
{:error, %Auth.Domain{log: "Invalid authorization type: narf"}}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
