Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receiving a secret_not_found message on login action #559

Closed
mc962 opened this issue Jan 8, 2019 · 4 comments
Closed

Receiving a secret_not_found message on login action #559

mc962 opened this issue Jan 8, 2019 · 4 comments

Comments

@mc962
Copy link

mc962 commented Jan 8, 2019

I've been trying guardian on an app together with absinthe to make a GraphQL API Phoenix application.

I got most of it working, and even the sign_up action works as expected. However, for the login action I am receiving a secret_not_found message in the response (no errors in the console).

From what I can tell, I am probably having an issue with guardian, as the message seems to be from either:
jwt.ex
and/or
token.ex

but I'm not really sure what issue I'm having, as from what I can tell, it's all set up more or less correctly. I did see this git issue with a similar error message, but I think I'm not having the same problems, as my Guardian module looks set up correctly from what I can see.

Here is the app: https://github.com/mc962/guack

@yordis
Copy link
Member

yordis commented Jan 8, 2019

@mc962 your config looks fine except that I don't know if this is happening on production. This definitely seems to be something on your side.

@mc962
Copy link
Author

mc962 commented Jan 8, 2019

It's on a dev environment.

Do you know what theoretically could be causing it to happen? Unfortunately I don't have as much experience with this package's codebase/elixir in general, so I'm not positive where to look aside from what I've already mentioned.
My understanding is that it's not picking up some secret somewhere, such as my secret_key in dev.exs, but I'm not quite sure where it's getting lost/why.

@yordis
Copy link
Member

yordis commented Jan 8, 2019

Check the name of your OTP, the name of your module and so on

@mc962
Copy link
Author

mc962 commented Jan 8, 2019

🤦‍♂️ 🤦‍♂️ 🤦‍♂️
Found it, it was the name of the module after all.

I had been using a context called Authentication, where the Guardian module was namespaced behind that module.

But my dev.exs config was asking for MyAppName.Guardian, instead of what I had, which was MyAppName.Authentication.Guardian. That's what I get for trying to be organized 😆

Thanks for the advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants