Ive made a project that can be found here:
https://github.com/rootkc/phx_auth_api
When I try to post to:
http://0.0.0.0:4000/api/login
with the body:
{ "user": { "username": "kenneth", "password": "kenneth" } }
That is a user that is in the database. I get the response:
{
"data": {
"token": "eyJhbGciOiJIUzUxM[...]gbPVHTsSvrCA"
}
}
When i then put that token in the header:
Àuthorization: :token
of the call http://0.0.0.0:4000/api/users
that has the Guardian pipeline plug
I get back the message: unauthenticated
And i have no idea, what i'm doing wrong. This is my first real Phoenix project and i tried to follow various guide but the {:guardian, "~> 1.0-beta"}
seems to be quite new, with bad documentation.