How upgrade devise 2.1.2 to devise 3.2.2 - ruby-on-rails

I want to upgrade my current devise from 2.1.2 to 3.2.2
I added the secret_key to the initialiser so the rails server starts fine.
But when I try to login I can't. Examining the logs didn't make me any smarter.
I just get a 401 Unauthorized exception in the Rails log.
Can anybody give direction how to upgrade? Or how I could debug this a little bit better?

Maybe you should check your sign in field. if you follow devise guide (https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address), your sign in field should be "login", not "email"

Related

problems with sign out, cookies and devise on rails

I have been trying to sign in after signing out on my application using devise but I am having an issue with the cookies I think because I have to refresh my web page in order to sign in again. I tried using activerecord-session_store gem and I follow the steps to configure it. I mean, I installed the gem, I generated the recommended migration on the gem documentation and generated the table using rake db:migrate command, I also changes the session_store.rb file but I feel that I am missing something to make it work since I tried it and the same happens. Please help me if you feel I am missing something or if you have other solution for this problem. Many thanks in advance
You are probably getting a "Can't verify CSRF token authenticity" error. Can you check your server logs?
In your ApplicationController please add the following and check if you get an error.
protect_from_forgery with: :exception

ActionController::InvalidAuthenticityToken Error when creating a doorkeeper application

I'm pretty new to rails and I'm beginning with rails-api.
Right now i'm trying to add authentication through doorkeeper using resource owner password credentials.
But when im going to the /oauth/applications page to set a new app to add my frontend for exemple, i get an error about an authenticity token:
ActionController::InvalidAuthenticityToken in Doorkeeper::ApplicationsController#create
As it's a page implemented in the doorkeeper gem itself, isn't it suppose to work by itself?
Does any one know what's going on and how to solve it?
Thank you guys
This is due to the forgery protection enabled by default by rails.
If you're working on an API only, my guess is that you can simply turned it off in the environment file (test/developpement/production.rb) by adding this line :
config.action_controller.allow_forgery_protection = false
Cheers.
It's an incompatibility with rails-api and doorkeeper.
My project are being started and based on this and other things, I've chose grape instead of rails-api. It works for me!
If you can do this, I can't help you now!
tip: Enjoy with grape!

Devise sign_out action not working

Ruby 1.8, Rails 2.3.15, devise 1.0.10 and warden 0.10.3
I have implemented admin using this example: https://github.com/plataformatec/devise/tree/v1.0. When I sign out it show the message but I can still acess those page without signing in again. Can anyone let me know what is wrong with it.
Thanks in advance.
SInce you have not added any code, I can just guess that you have missed out the before filter:
before_filter :authenticate_user!
use this in the controller abouve all methods, this method is available by devise.

Devise error using rails 3.0.1 on sign_in action

I'm developing a rails 3 app using rails 3.0.1 and I'd like to use devise for user auth, but when I login with a user email, I get this error:
RuntimeError in Devise/sessionsController#create
In order to use respond_with, first you need to declare the formats your controller responds to in the class level
I installed devise using Gemspec.
I have the same issue yesterday and today i up a ticket and they fix the problem. Make a bundle update to have the fix version.
Make sure this is the first entry in your routes file
devise_for :users
Consider upgrading to Rails 3.0.3

Authlogic_OpenID - "uninitialized constant Rack::OpenID"

So I followed the railscast tutorial (http://railscasts.com/episodes/170-openid-with-authlogic) and used the old version of the plugin from Ryan's git file. I can now successfuly create/register a user using OpenID (Google), but I cannot log in with this user. When I submit the OpenID that has been registered, I get "uninitialized constant Rack::OpenID". Any ideas?
Thanks!
I would suggest trying the latest version of the plugin, or the gem.
Things change quick in rails, and old code can break with new versions of rails.
I would suggest trying Devise, it is easier for integrate OpenId, Facebook, Tweeter ...
https://github.com/plataformatec/devise

Resources