dwyl / auth-mvp

:key: Prototype Authentication Service
https://auth-mvp.herokuapp.com/
4 stars 0 forks source link

Compilation error in file lib/plugs/authenticate_person.ex #16

Closed nelsonic closed 4 years ago

nelsonic commented 4 years ago

After running git pull on master branch and mix deps.get, I attempted to run mix test on localhost and got the following error:

Compiling 3 files (.ex)

== Compilation error in file lib/plugs/authenticate_person.ex ==
** (ArgumentError) ranges (first..last) expect both sides to be integers, got: TokenAuthMvp..verify_and_validate(jwt)
    (elixir 1.10.1) lib/kernel.ex:3287: Kernel.range/3
    (elixir 1.10.1) expanding macro: Kernel.".."/2
    lib/plugs/authenticate_person.ex:33: AuthMvp.Plugs.AuthenticatePerson.validate_token/2

The line in question authenticate_person.ex:33 is AuthMvp.Token.verify_and_validate(jwt): https://github.com/dwyl/auth-mvp/blob/33af8ec88229c41da7944d5ad589d76ac9717bbd/lib/plugs/authenticate_person.ex#L32-L40

I have all the required environment variables listed in .env_sample ...

@SimonLab can you help clarify how to run the project on localhost?

SimonLab commented 4 years ago

From the error above, are you sure you don't have a typo: TokenAuthMvp..verify_and_validate(jwt) should be TokenAuthMvp.verify_and_validate(jwt)

I'm going to check on my localhost too

nelsonic commented 4 years ago

I revered to a previous version of the file https://github.com/dwyl/auth-mvp/edit/master/lib/plugs/authenticate_person.ex and it works. 👍