Skip to content

Instantly share code, notes, and snippets.

@samueljmurray
Last active March 27, 2017 10:54
Show Gist options
  • Save samueljmurray/2acf9c0402da4f10a73d41c1208526fe to your computer and use it in GitHub Desktop.
Save samueljmurray/2acf9c0402da4f10a73d41c1208526fe to your computer and use it in GitHub Desktop.
Authorized employee
defp authorized_employee(conn, user_auth) do
conn = Guardian.Plug.api_sign_in(conn, user_auth, :access, perms: %{employee: [:full]})
jwt = Guardian.Plug.current_token(conn)
conn
|> put_status(201)
|> render(UserView, "show.json", user: user_auth.user, jwt: jwt)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment