devise
devise copied to clipboard
Help wanted : how to record and display sign_out sign_in timestamps in view?
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.
- sign_in_at
- sign_in_count
- sign_out_at
- forced_sign_out_count due to inactivity
- 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