Skip to content

Show session timeout warning and limit sessions to 30min of inactivity#7282

Merged
mrcasals merged 47 commits intodecidim:developfrom
mainio:feature/session_timeout_warning
Feb 11, 2021
Merged

Show session timeout warning and limit sessions to 30min of inactivity#7282
mrcasals merged 47 commits intodecidim:developfrom
mainio:feature/session_timeout_warning

Conversation

@lahdeero
Copy link
Copy Markdown
Contributor

@lahdeero lahdeero commented Feb 4, 2021

🎩 What? Why?

Currently session timeouts when user has been idle for one week! For security reasons it might be better to sign out users when they have been idle for certain time (e.g. 30 minutes). This pull request adds warning for user, who has been idle for too long and will be signed out after 1 minute (after displaying the warning) if user is still not responding.

📌 Related Issues

https://meta.decidim.org/processes/roadmap/f/122/proposals/16220

Testing

  1. Change config.timeout_in = 3.minutes @ decidim-core/config/initializers/devise.rb
  2. Sign in
  3. Idle (after 30 seconds it shows warning and after 1 minute and 30 seconds you will be logged out).

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

session_timeout_warning2

♥️ Thank you!

ahukkanen and others added 30 commits July 20, 2019 23:19
* New translations en.yml (French)

* New translations en.yml (Hungarian)

* New translations en.yml (Hungarian)
@andreslucena andreslucena changed the title Feature session timeout warning Session timeout warning Feb 9, 2021
@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Feb 9, 2021

@decidim/product can you review the solution, please? Thanks!

@carolromero
Copy link
Copy Markdown
Member

@mrcasals this looks good, screenshots do the trick this time. Thanks for the PR @lahdeero!

@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Feb 9, 2021

@lahdeero can you check the conflicts? Thank you!

mrcasals
mrcasals previously approved these changes Feb 9, 2021
@mrcasals
Copy link
Copy Markdown
Contributor

mrcasals commented Feb 9, 2021

Nice job, @lahdeero! Let's wait for tests to finish and we'll merge it 😄

@mrcasals
Copy link
Copy Markdown
Contributor

@lahdeero I'm sorry, some conflicts appeared and I can't solve them (I guess I don't have permisions to do it because I can't push to your fork). Can you fix them and we'll merge the PR?

Thanks!

@mrcasals mrcasals changed the title Session timeout warning Show session timeout warning and limit sessions to 30min of inactivity Feb 10, 2021
@lahdeero
Copy link
Copy Markdown
Contributor Author

Should be fixed now @mrcasals

@mrcasals mrcasals merged commit b19215c into decidim:develop Feb 11, 2021
@ahukkanen ahukkanen deleted the feature/session_timeout_warning branch February 11, 2021 13:29
lahdeero added a commit to mainio/decidim that referenced this pull request Feb 16, 2021
oriolgual pushed a commit that referenced this pull request Mar 5, 2021
* clear interval before unload

* Prevent redirect on ajax requests

* Cleaning comments and loggers

* Add test

* Simulate just before session expiration

* Test without separate method

* Tests for different requests

* Trying to get test work in CI

* Remove comment

* Improve test logic

* Update beforeunload

* Fix test because session timeout warning: #7282

Co-authored-by: Antti Hukkanen <antti.hukkanen@mainiotech.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants