-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: Refresh session on request #520
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this seems to work correctly on dev-green, looks good to me!
@digitalcora Just realized that there is some |
This reverts commit 879513c.
If you express it this way it may work better: - @idle_time Application.compile_env!(:screenplay, __MODULE__)[:idle_time]
+ @idle_time Application.compile_env!(:screenplay, [__MODULE__, :idle_time]) The difference should be that with the latter, |
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. Also, when an admin's session has expired and they try to load new data in the admin UI, they will get a message indicating they need to refresh the page, instead of the generic "an error occurred".
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. Also, when an admin's session has expired and they try to load new data in the admin UI, they will get a message indicating they need to refresh the page, instead of the generic "an error occurred".
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. Also, when an admin's session has expired and they try to load new data in the admin UI, they will get a message indicating they need to refresh the page, instead of the generic "an error occurred".
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. Also, when an admin's session has expired and they try to load new data in the admin UI, they will get a message indicating they need to refresh the page, instead of the generic "an error occurred".
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message. In support of the above feature being able to distinguish HTML page requests from API requests, this _also_ disentangles some pipelines in the router where some API endpoints were piped through both "browser" and "api", causing their format to be improperly set as HTML.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message. In support of the above feature being able to distinguish HTML page requests from API requests, this _also_ disentangles some pipelines in the router where some API endpoints were piped through both "browser" and "api", causing their format to be improperly set as HTML.
Using the admin UI was previously plagued by auth errors that would occur after just a few minutes of idle time and required refreshing the page, losing any work in progress. These changes should improve how we handle authentication, allowing an admin to be idle for up to 30 minutes and signed in for up to 12 hours before needing to reauthenticate, following the TID Session Management guidelines and the prior art of mbta/screenplay#520. This also revises and unifies how data fetching works in the admin UI, to allow showing admins a message indicating their session has expired when that happens (regardless of the interaction), rather than a generic error message. In support of the above feature being able to distinguish HTML page requests from API requests, this _also_ disentangles some pipelines in the router where some API endpoints were piped through both "browser" and "api", causing their format to be improperly set as HTML.
Screenplay is very often left open in people's browser. This will eventually lead to an outdated session failing in our request pipeline and cause a CORS error due to a redirect. I followed this Notion doc to get a sense of what our session best practices are and that helped me find this PR. I followed in that PR's footsteps for the solution to our problem. We now set an idle time of 30 minutes (although the plug will prevent users from exceeding that) and a max session age of 12 hours.