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

  • Home
  • SEARCH
  • 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 8032789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:29:50+00:00 2026-06-05T01:29:50+00:00

I’m not sure what I did, but a signed in user can access the

  • 0

I’m not sure what I did, but a signed in user can access the new_user_session_path and new_user_registration_path. Usually in devise, a user should not be allowed to access those paths. I’m using cancan if the makes a difference. I created a new rails application and copied over the routes and extended the registrations and sessions controller and cannot replicate the problem.

If someone could even point me in the direction of where the redirecting is done in Devise, I would appreciate it.

In the initializers/devise.rb config file, the only line added to the default file is:

config.scoped_views = true

Let me know if I can supply any other useful information.
I’m using Devise (1.5.3), CanCan (1.6.7), and Rails (3.1.1)

Routes File:

MyApp::Application.routes.draw do

  devise_for :users, :controllers => { :sessions => "sessions", :registrations => "registrations" }, :skip => [ :sessions, :registations ] do

    get    '/signin'   => 'sessions#new',     :as => :new_user_session
    post   '/signin'   => 'sessions#create',  :as => :user_session
    delete '/signout'  => 'sessions#destroy', :as => :destroy_user_session

    get    '/signup'       => 'registrations#new',    :as => :new_user_registration
    post   '/users'        => 'registrations#create', :as => :user_registration
    get    '/users/cancel' => 'registrations#cancel', :as => :cancel_user_registration
    get    '/settings'     => 'registrations#edit',   :as => :edit_user_registration

    put    '/account'      => 'registrations#update'
    delete '/users'        => 'registrations#destroy'
  end

  resources :users

  match '/contact',   :to => 'pages#contact'

  root :to => 'pages#contact'

end

Extended Devise Registrations Controller

class RegistrationsController < Devise::RegistrationsController

  # POST /resource
  def create
    build_resource

    resource.company = Company.find_by_code(params[:company_code])
    resource.role = Role.find_by_name("Basic")

    if resource.save
      if resource.active_for_authentication?
        set_flash_message :notice, :signed_up if is_navigational_format?
        sign_in(resource_name, resource)
        respond_with resource, :location => after_sign_up_path_for(resource)
      else
        set_flash_message :notice, :inactive_signed_up, :reason => inactive_reason(resource) if is_navigational_format?
        expire_session_data_after_sign_in!
        respond_with resource, :location => after_inactive_sign_up_path_for(resource)
      end
    else
      clean_up_passwords resource
      respond_with resource
    end
  end

end

Extended Devise Sessions Controller:

class SessionsController < Devise::SessionsController
  layout "sessions"
end

I realize that I can add some code to the controller actions or in a before filter to check for a logged in user and redirect them. Devise, however, offers the functionality and I shouldn’t have to do that. I’m afraid that by doing so I may be ignoring a larger problem, perhaps with Devise’s configuration.

I appreciate any help! Thank you!

  • 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-06-05T01:29:52+00:00Added an answer on June 5, 2026 at 1:29 am

    After a lot of searching and trying, I decided to re-implement devise and it did the trick. I’m still not sure how I managed to break the functionality in the first place.

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

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
Seemingly simple, but I cannot find anything relevant on the web. What is the
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.