After upgrading Rails app from 3.2 to 4.2.3 devise not working properly

52 views
Skip to first unread message

Ricardo Berdejo

unread,
Aug 11, 2015, 4:51:57 PM8/11/15
to Devise
Hi all.

I just started upgrading a Rails app from 3.2 to 4.2.3 and after updating my gems devise stopped working. I've not got any error or warning on the console/browser so I'm lost.

I have set up the after_sign_in_path_for which is not working. The user is saved in the database and the confirmation email is sent though.

Any help is really appreciated.
Thanks in advance

Carlos Antonio da Silva

unread,
Aug 11, 2015, 5:19:49 PM8/11/15
to Devise
You need to provide us more information, otherwise I have no idea how to help.

Can you share some code? Which devise version are you using? Have you updated devise? The more details you can give, the better.

--

---
You received this message because you are subscribed to the Google Groups "Devise" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
At.
Carlos Antonio

Ricardo Berdejo

unread,
Aug 11, 2015, 7:09:28 PM8/11/15
to Devise
sure. I cannot show too much code because is kind of sensitive but Iĺl do my best.

My gems.

ruby '2.1.1'
gem 'rails', '4.2.3'
gem 'devise', '~> 3.5.2'


Some parts of my User model:

class User < ActiveRecord::Base
 
# Include default devise modules. Others available are:
 
# :confirmable, :lockable, :timeoutable and :omniauthable
  devise
:database_authenticatable, :registerable,
         
:recoverable, :rememberable, :trackable, :validatable,
         
:confirmable

 
def after_confirmation
   some code here
 
end
end

Part of my routes.rb

Rails.application.routes.draw do
  devise_for
:admin_users, ActiveAdmin::Devise.config
 
ActiveAdmin.routes(self)

  devise_for
:users, path: '', :path_names => { sign_in: 'login', sign_up: 'registro' }

  authenticated
:user do
    root
:to => "wellcome#index", as: :welcome
 
end
end

This is part of my Application Controller

class ApplicationController < ActionController::Base
  protect_from_forgery
with: :exception

 
def after_sign_in_path_for(resource)
   
case resource
   
when User then dashboard_path
   
when AdminUser then admin_dashboard_path
   
end
 
end

 
def after_confirmation_path_for(resource_name, resource)
    redirect to dashboard_path
 
end
end

I'm also using custom views for registrations/sessions/mailers/confirmations/ etc.

As I said, I have neither console errors nor warnings to show you here.

Thank you 4 ur time.

Ricardo Berdejo

unread,
Aug 12, 2015, 2:48:15 PM8/12/15
to Devise
Well, I think I'm closer right now.

I found the initializer has changed and also I found config.allow_unconfirmed_access_for = 15.days.

I set 15 days but I notices the confirmation_sent_at is nil. is that correct?
Reply all
Reply to author
Forward
0 new messages