Expire inactive sessions, optionally allow to stay signed in #82

Merged
raucao merged 3 commits from feature/8-session_timeouts into master 2023-03-31 07:58:25 +00:00
Owner

When "remember me" is checked, keep user logged in for two weeks after last activity. Otherwise, expire the session after 30 minutes.

closes #8

When "remember me" is checked, keep user logged in for two weeks after last activity. Otherwise, expire the session after 30 minutes. closes #8
raucao added the
kredits-1
label 2023-02-19 05:45:50 +00:00
raucao added 1 commit 2023-02-19 05:45:51 +00:00
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details
344e4e5bcc
Add time limit for inactive sessions
closes #8
bumi reviewed 2023-02-19 13:24:05 +00:00
@ -6,1 +6,4 @@
connect() {
// Devise timeoutable ends up adding a second flash message without content
// TODO investigate bug
if (this.element.textContent.trim() == "true") return;
Owner

so the content has the value "true"?

so the content has the value "true"?
Author
Owner

Yeah, for that unexpected additional flash message. I figured it's OK to hotfix like this, since no message should ever just say "true".

Yeah, for that unexpected additional flash message. I figured it's OK to hotfix like this, since no message should ever just say "true".
@ -230,3 +230,3 @@
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
# config.timeout_in = 30.minutes
config.timeout_in = 24.hours
Owner

I tend to have this number higher these days.

I tend to have this number higher these days.
Author
Owner

What timeout would you propose?

(Keep in mind that this is the central account management app, where you can potentially take over a lot of services if you're able to access an active browser session.)

What timeout would you propose? (Keep in mind that this is the central account management app, where you can potentially take over a lot of services if you're able to access an active browser session.)
Author
Owner

@bumi Did you see my question here?

@bumi Did you see my question here?
Owner

yeah, not sure... it's always the balance between convenience that I don't have to login again and some "security" in case a user uses a "public" computer.

but yeah, leave it to a day. if the user does not visit the site again after a day they have to login again.

yeah, not sure... it's always the balance between convenience that I don't have to login again and some "security" in case a user uses a "public" computer. but yeah, leave it to a day. if the user does not visit the site again after a day they have to login again.
Author
Owner

Since I also wasn't quite happy with forcing the tradeoff this way, I have overhauled the sign-in form and added a remember-me button, using our new toggle switch component and Devise's Rememberable strategy. So now it's better both ways: expiring faster when needed, and staying logged in when the user thinks it's safe.

Updated PR description and added a screenshot.

@bumi I'll wait for last review and approval before merging.

Since I also wasn't quite happy with forcing the tradeoff this way, I have overhauled the sign-in form and added a remember-me button, using our new toggle switch component and Devise's Rememberable strategy. So now it's better both ways: expiring faster when needed, and staying logged in when the user thinks it's safe. Updated PR description and added a screenshot. @bumi I'll wait for last review and approval before merging.
raucao requested review from bumi 2023-02-23 23:41:07 +00:00
raucao force-pushed feature/8-session_timeouts from 344e4e5bcc to a8a8fba14c 2023-03-19 11:08:19 +00:00 Compare
raucao changed title from Add time limit for inactive sessions to Expire inactive sessions, optionally allow to stay signed in 2023-03-19 11:09:45 +00:00
raucao added
kredits-2
and removed
kredits-1
labels 2023-03-19 11:14:12 +00:00
raucao added the
release
minor
label 2023-03-28 14:29:22 +00:00
raucao added the
security
label 2023-03-28 14:40:12 +00:00
raucao requested review from greg 2023-03-29 07:45:27 +00:00
raucao requested review from galfert 2023-03-29 07:45:27 +00:00
galfert approved these changes 2023-03-31 00:34:41 +00:00
raucao merged commit 324809f77e into master 2023-03-31 07:58:25 +00:00
raucao deleted branch feature/8-session_timeouts 2023-03-31 07:58:25 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: kosmos/akkounts#82
No description provided.