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

Undefined method remember_me! for (my user class) #812

Open
mark100net opened this issue Jan 20, 2018 · 0 comments
Open

Undefined method remember_me! for (my user class) #812

mark100net opened this issue Jan 20, 2018 · 0 comments

Comments

@mark100net
Copy link

I am using version 0.11.0 with Rails 5.1.4. I was not using remember_me originally and just started trying to use it.

My sorcery.rb has this:

Rails.application.config.sorcery.submodules = [:remember_me]
 ....

 config.user_class = "Person" #last line

My Person class this:

class Person < ApplicationRecord
     authenticates_with_sorcery!

My people table has remember_me_token and remember_me_token_expires_at

I try to create the session like so:

if @person && (@person = login(@person.email, params[:password], true)) <-- NoMethodError 
     redirect_back_or_to(admin_root_path, notice: "Login successful")

The error message is

undefined method `remember_me!' for #<Person:0x00000000049cff28>

Am I missing something?

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

No branches or pull requests

1 participant