unividuell / life-reminder

0 stars 0 forks source link

handle (google) session timeout #13

Closed cleemansen closed 1 year ago

cleemansen commented 1 year ago

solve #12

cleemansen commented 1 year ago

This PR handles the Google session which expires after 1 hour.

  1. Authentication changed to Google One-Tap. This is not strictly necessary for handling the session end, but it requires less user interaction to login (in best case zero interaction)
  2. Authorization tracks the expiration date-time of the session
  3. When the session ends (~60 seconds remaining) the main content will be replaced by the timeout message
  4. This timeout message contains a refresh action. This action will renew the session (w/o any Google authentication/authorization interaction)

All of this is technically also in an automatic way possible. Why not doing it this way?

  1. Not sure if it is okay to renew a Google session on the behalf of a user (TOS?)
  2. The Google consent pop-up window will appear (implicit oauth2 flow). If this happens in an automatic fashion you will lose your OS focus - very annoying if Life Reminder tap is not in the foreground (high chance!)
cleemansen commented 1 year ago

This is now live at production! There are many (edge) cases to test and to review. Have fun..

cleemansen commented 1 year ago