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

confirmable feature bugs? #263

Closed
seoyoochan opened this issue Jun 4, 2015 · 2 comments
Closed

confirmable feature bugs? #263

seoyoochan opened this issue Jun 4, 2015 · 2 comments

Comments

@seoyoochan
Copy link

I don't use 'devise' gem, but only an initializer devise.rb.
I successfully sent a email confirmation link with the following signed up user.
but I believe I found some problems about the confirmable feature.
Please check them if I was correctly realized.

problem

** the generated confirmation link lost the full length of the confirmation token. **
the confirmation token is

:confirmation_token => "d2880361f4baaf0c8304f393a3d6a41a49042f6e4ee2f2d3703f24b503bd6d8f"
<%= link_to 'Confirm my account', confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %>

the above link actually returns this url address.

http://api.localhost:3000/v1/auth/confirmation?config=default&confirmation_token=ammABW7Y2ge1yUGk5xN3&redirect_url=http%3A%2F%2Flocalhost%3A9000%2F%23welcome

when I clicked the link it requests GET to omniauth/confirmation!
What the heck is going on?
so,, I've been debugging about this problem and realized User instance does not have the Devise gem's method, which is 'confirm_by_token' method.
the method is used to find a user by its confirmation token and try to confirm it.
Look at the below

2.2.2 :003 > User.first.confirm_by_token("d2880361f4baaf0c8304f393a3d6a41a49042f6e4ee2f2d3703f24b503bd6d8f")
  User Load (1.3ms)  SELECT  "users".* FROM "users"  ORDER BY "users"."id" ASC LIMIT 1
NoMethodError: undefined method `confirm_by_token' for #<User:0x007f88c2197100>
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activemodel-4.2.1/lib/active_model/attribute_methods.rb:433:in `method_missing'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/rolify-4.0.0/lib/rolify/role.rb:78:in `method_missing'
    from (irb):3
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/railties-4.2.1/lib/rails/commands/console.rb:110:in `start'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
    from /Users/seoyoochan/dev/bitsnut/bitsnut-api/bin/rails:8:in `<top (required)>'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/commands/rails.rb:6:in `call'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/command_wrapper.rb:38:in `call'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:183:in `block in serve'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:156:in `fork'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:156:in `serve'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
    from /Users/seoyoochan/.rvm/gems/ruby-2.2.2@api/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/seoyoochan/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/seoyoochan/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'2.2.2 :004 > ^C

Am I completely doing wrong about implementing email confirmation feature or what?

@neutronz
Copy link
Contributor

neutronz commented Sep 1, 2016

@seoyoochan I know its late in the game on this one, but did you ever come to a conclusion?

@zachfeldman
Copy link
Contributor

Hi there @seoyoochan ,

In an effort to cleanup this project and prioritize a bit, we're marking issues that haven't had any activity in a while with a "close-in-7-days" label. If we don't hear from you in about a week, we'll be closing this issue. Obviously feel free to re-open it at any time if it's the right time or this was done in error!

If you are still having the issue (especially if it's a bug report) please refer to our new Issue Template to provide some more details to help us solve it.

Hope all is well.

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

3 participants