Skip to content

Side effect of stored_location_for #23

@Sylvain

Description

@Sylvain

Devise method stored_location_for has a side effect, it removes the value in session['user_return_to'].

Here you use it:

devise_stored_location = stored_location_for(resource) # Grab the current stored location before it gets lost by warden.logout

But you only restore it when otp_challenge_required_on? is true. So in the else branch, the initial stored_location_for is lost. I suggest either:

  • restore the value in all cases
  • store devise_stored_location only in the otp_challenge_required_on? branch.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions