devise icon indicating copy to clipboard operation
devise copied to clipboard

Help wanted : how to record and display sign_out sign_in timestamps in view?

Open rahulmr opened this issue 4 years ago • 0 comments

Pre-check

  • Have not found exact resolution on stackoverflow something related to warden but not sure how to implement

Environment

  • Ruby 3.0.2
  • Rails 6.1.4.1
  • Devise 4.8.0

Current behavior

Use case - I want to monitor user activity like sign_in time, sign_out time in the sense at what time user logged in first time and logged out for last time and also the sign_in counts. So that I can calculate time spent by user on applications. I also want to keep 10 minutes as idle time to initiate forced logout. Currently, sign_in_at is available and also sign_in_count but no sign_out and forced_sign_out

Expected behavior

  • Need some help to get below user activity details on a page.
  1. sign_in_at
  2. sign_in_count
  3. sign_out_at
  4. forced_sign_out_count due to inactivity
  5. time spent by user from morning to night (or business hour time_zone specific like IST 9 am to 6 pm) first login after 9 am and last sign out after 6 pm

Please point me to some good article. Thanks

rahulmr avatar Nov 26 '21 06:11 rahulmr