Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update return_to before redirect to login #700

Open
wants to merge 40 commits into
base: develop
Choose a base branch
from

Conversation

MattBudz
Copy link
Contributor

@MattBudz MattBudz commented May 19, 2020

Summary

Spec

Currently, when a user is on any view and the session times out, the user is redirected back to the login view. Once logged back in the user goes to projects#show in ce or projects#index in pro.

Besides that, when they are using the editor while timed out, the preview on the right does not reflect their changes. (because they have been logged out). This isn't good UX and would confuse users.

Proposed solution

Return the user back to the page they were on when the session timed out.
While the user is on the editor while timed out, show an alert message to inform users to login again

Check List

  • Added a CHANGELOG entry

Base automatically changed from master to main February 1, 2021 15:56
app/controllers/sessions_controller.rb Outdated Show resolved Hide resolved
app/controllers/sessions_controller.rb Outdated Show resolved Hide resolved
vendor/assets/javascripts/jquery.textile.js Outdated Show resolved Hide resolved
app/helpers/markup_helper.rb Outdated Show resolved Hide resolved
end

it 'redirects to previous page' do
Timecop.freeze(Time.now + 1.hour) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an alternative to using Timecop.freeze? Introducing more #freeze calls might cause issues in CI.

@@ -73,6 +73,8 @@
# arbitrary gems may also be filtered via:
# config.filter_gems_from_backtrace("gem name")

config.include ActiveSupport::Testing::TimeHelpers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def return_to
if request.get?
warden_options[:attempted_path]
elsif request.post?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants