Created
February 25, 2018 21:29
-
-
Save shahryarjb/177bd79cc638d558116fcefea7810f5a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def kab(conn, %{"token" => token}) do | |
case ApiTrangell.Guardian.decode_and_verify(token) do | |
{:ok,claims} -> | |
IO.puts claims | |
json conn, %Person{token: "verify"} | |
{:error, any} -> conn | |
|> put_status(403) | |
|> json %{ error: "unauthorized"} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment