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

Support for model that is not named "User" #57

Closed
alexdesi opened this issue Aug 14, 2019 · 2 comments · Fixed by #58
Closed

Support for model that is not named "User" #57

alexdesi opened this issue Aug 14, 2019 · 2 comments · Fixed by #58

Comments

@alexdesi
Copy link

alexdesi commented Aug 14, 2019

I did not find the answer of this on the docs (I might have overlooked it).
I am trying to use passwordless, I do not have a model name User, the model used in the authentication is named Teacher.

So in the routes.rb, I got:
passwordless_for :teachers

but when I access to /teachers/sign_in/my-token I get:

NameError in Passwordless::SessionsController#show
uninitialized constant Passwordless::SessionsController::User

Is there a way to use a model NOT named User? if so what I am missing?

Note that the view /teachers/sign_in works as expected.

Thanks!

@mikker
Copy link
Owner

mikker commented Aug 14, 2019

I think a rogue User snuck in here

reset_passwordless_redirect_location!(User)

Thanks for finding it! I'll take a look.

@mikker
Copy link
Owner

mikker commented Aug 14, 2019

Just pushed 0.8.1 with a fix for this. Thanks for reporting!

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

Successfully merging a pull request may close this issue.

2 participants