# :cocktail: Bartender

> JWT authentication using [Absinthe]( + [Guardian](

## Installation

If [available in Hex](, the package can be installed
by adding `bartender` to your list of dependencies in `mix.exs`:

def deps do
    {:bartender, "~> 0.1.0"}

Documentation can be generated with [ExDoc](
and published on [HexDocs]( Once published, the docs can
be found at [](

## Usage

You can call `Bartender.Plug` explicitly with `, MyApp.Guardian)` 

If using in Phoenix, or any other app that uses `Router`, establish the `Plug` like so.

defmodule MyApp.Router do
  use MyApp, :router

  pipeline :api do
    plug :accepts, ["json"]
    plug Bartender.Plug, MyApp.Guardian

This `Plug` makes use of `Absinthe.Plug`, inserting the verified resource (in this case, a `current_user`) into the Connection, which can then be accessed from a Resolver. See the Absinthe [docs]( for more info.