Server credential store returning nil
kdiogenes opened this issue · 2 comments
kdiogenes commented
I'm using phoenix 1.4.0-rc0 and elixir 1.7.3 and executing the following in iex:
Interactive Elixir (1.7.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> Coherence.CredentialStore.Server.put_credentials("foo", 1)
:ok
iex(2)> Coherence.CredentialStore.Server.get_user_data("foo")
nil
I'd expect it to return 1.
Is it an incompatibility with phoenix 1.4 or I'm making wrong assumptions about how credential store works?
smpallen99 commented
As you can see from this line of code, user_data must be a map or struct with a :id
field.
kdiogenes commented
Thanks for quick feedback @smpallen99, it worked perfectly!
I get mislead by https://hexdocs.pm/coherence/Coherence.Authentication.Token.html#add_credentials/3 documentation. I will submit a PR soon.
Thanks!