#415 ✓resolved
Tom Locke

Visiting sign-up page when logged in gives a permission denied error

Reported by Tom Locke | May 1st, 2009 @ 09:32 AM | in Hobo 1.0 - Final

There should be no link to this page when logged in but you can end up there by accident (e.g. back button). It really should just redirect to home page or redirect(:back)

Comments and changes to this ticket

  • Tom Locke

    Tom Locke May 1st, 2009 @ 09:32 AM

    • State changed from “new” to “open”
  • Marcelo Giorgi

    Marcelo Giorgi June 23rd, 2009 @ 01:00 AM

    I've commit a fix for it on my branch 415_visiting_sign-up_page_when_logged_in_gives_a_permission_denied_error (of my fork git://github.com/mgiorgi/hobo.git). A patch is attached here if it is easier for you to see that way.

    The fix that I committed, defines a new method hobo_signup, which redirects the user to :back (or homepage in case there is no back) or render default implementation of signup's page otherwise.

  • Tom Locke

    Tom Locke June 23rd, 2009 @ 02:01 PM

    Looks good. I'm thinking maybe a small change like this

    def hobo_signup(&b)
      if logged_in?
        redirect_back_or_default(home_page) 
      else
        creator_page_action(:signup, &b)
      end
    end
    

    would be clearer? It took me a minute to figure out why the unless_performed? was needed. Or did I miss something?

    Also, the :signup symbol needs to be taken out of the list in available_auto_actions_with_user_actions, otherwise the 'automatic' signup method gets generated and then just overwritten.

  • Marcelo Giorgi

    Marcelo Giorgi June 23rd, 2009 @ 02:40 PM

    I've pushed the corrections (to the same branch & attached a patch with a corrected version) that you mentioned.

    You're right, its clearer this way (At first, I thought to implement it as you mentioned. But I changed later because seemed more hobo's style (looking to other methods) the option that I picked up :P).

  • Bryan Larsen

    Bryan Larsen October 29th, 2009 @ 11:05 PM

    • State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tags

Pages