Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6975609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:23:25+00:00 2026-05-27T17:23:25+00:00

I can’t seem to get a user logged into our admin panel after upgrading

  • 0

I can’t seem to get a user logged into our admin panel after upgrading our app from Rails 2.3.x to Rails 3.1.3. I’m using the latest version of Devise, which at the time of this post is v1.5.3.

A POST to the session#create route returns a 401 response (and all the params look like they’re going in properly); it happens when Warden tries to auth the user using one of Devise’s strategies (:database_authenticatable). Here’s my user model.

class User < ActiveRecord::Base
  devise :database_authenticatable, :validatable
  attr_accessible :email, :password, :password_confirmation
end

I’ve got an overridden Devise::SessionsController in my :admin namespace (the logins are for admins only, and they’ve got their own site layout, thus the override). There’s nothing special in the controller, really, other than the layout:

class Admin::SessionsController < ::Devise::SessionsController
  layout "admin"
end

I do have slightly customized routes, and here’s the code that I’ve got for that.

devise_for :users, :controllers => { :sessions => 'admin/sessions' }

I have the csrf_meta_tag bit in my layout’s headers, and my ApplicationController has the protect_from_forgery line in it. The form’s errors are empty when it comes back to re-render the page.

I’ve stepped through the code (all the way into lib/warden/proxy.rb), and Warden doesn’t seem to think the :database_authenticatable strategy I’m using is valid (Warden’s source code for that part). The user is a valid user… I’ve created it via an Rails rails console IRB session, from scratch, with a valid password and everything. I would hope it should recognize that as valid, right? Or am I even barking up the right tree?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:23:26+00:00Added an answer on May 27, 2026 at 5:23 pm

    Wow, I’m kind of a fool. After stepping into Devise’s authenticatable strategy, it became clear to me that in my devise.rb configuration file (which I had copied in from another project and tweaked) had :username listed as an authentication_key, and not :email like it should have been. Changed it to :email and now it works.

    In a related story, I now have a somewhat murky understanding of how Devise works with Warden.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
Can't seem to get the Back Button to appear in a UINavigationController flow. I
Can a LINQ enabled app run on a machine that only has the .NET
Can I get a 'when to use' for these and others? <% %> <%#
Can I call a java class method from inside a flash movie?
Can I style a link on an iPhone when the user presses and holds
I am currently running into a problem where an element is coming back from
Can i get the source code for a WAMP stack installer somewhere? Any help
Can we put functions to determine the condition for our list comprehensions. Here is
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.