rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
464 stars 493 forks source link

Provide a friendly message if one gets an Invalid authenticity token, when signed in. #3845

Open awwaiid opened 1 year ago

awwaiid commented 1 year ago

Summary

If a user's session expires and they are trying to access the system, provide a friendly message (instead of the blank screen they are currently getting)

Why fix

Always nice to reduce user-facing nasty errors, or at least mitigate them

Details

This comes from us getting a fair number of invalid authenticity tokens with accompanying user information. Per the note below, we believe it is a case of expired sessions.

If the user session has expired when the user is attempting to access the system, we would like them to get a friendly message asking them to log in again.

Notes

Criteria for completion

manuel1280 commented 1 year ago

Hi, I would like to take It

manuel1280 commented 1 year ago

@awwaiid haven't managed to replicate the error in Local, When I try either deleting the auth token in the html, dropping the cache, or changing the expiration time in Devise with config.timeout_in = 10.seconds, the application makes a correct redirection to Login with the message "Your session expired. Please sign in again to continue."

Can you give the full Bugsnag message error to look into more deeply, please

github-actions[bot] commented 1 year ago

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

github-actions[bot] commented 1 year ago

Automatically unassigned after 7 days of inactivity.

kiranbpatil commented 11 months ago

@awwaiid - +1 on @manuel1280's above comment After the session has expired - I can see the user routed back to sign-in page with message:

Screenshot 2023-12-02 at 9 31 51 PM

Did you observe something different?

manuel1280 commented 11 months ago

@kiranbpatil Yes, I see that message