Yeah I'm a moron.  No it won't work.  You could add an identity method to AnonymousUser that returns nil, but that is probably overkill.

The intent was that AnonymousUser responds to most of the methods that User has, but :identity might be too specific.


On Mar 4, 2014, at 8:36 AM, Karen Chan <notifications@github.com> wrote:

> In app/controllers/sessions_controller.rb:
> 
> > @@ -45,7 +45,14 @@ def ask_which_account; end
> >  
> >    def return_to_app
> >      FinishUserCreation.call(current_user)
> > -    redirect_to session.delete(:return_to) || root_url
> > +    if current_user.try(:identity).try(:should_reset_password?)
> so it's ok to do current_user.identity.try(:should_reset_password?)? this works even if current user is anonymous?
> 
> —
> Reply to this email directly or view it on GitHub.
>