Automate device/hardware detection and implement active session management for user profiles.

Feature Request

Summary: Automate device/hardware detection and implement active session management for user profiles.


Problem Statement: Currently, users are manually asked to fill in their device details (Hardware, OS, RAM, Internet Speed) in their profile, which is prone to errors and poor user experience. Additionally, users lack visibility and control over their active logins across multiple devices, which poses a security and privacy concern.


Proposed Solution:

1. Automated Device Detection:

  • Implement the client side automatic detect of the following specifications upon login:
    • Operating System (OS)
    • Browser details
    • RAM capacity
    • CPU information
  • Internet Speed: Continue utilizing the existing dedicated network testing library currently implemented in the app to measure internet speeds.
  • Combine this hardware data with the existing internet speed telemetry and send it to the server to attach to the user's active session upon login.

2. Session Management:

  • Add a new "Active Sessions" section in the user profile settings.
  • Display a list of all devices/browsers where the user is currently logged in, including metadata like OS, browser, IP location, and last active time.
  • Provide a "Sign Out" button next to each session (to remotely terminate it) and a global "Sign Out of All Other Devices" option.

3. API Endpoints :

  • Leverage existing endpoints in the Corpus Server Platform if available, or propose/implement new endpoints to support this feature (create necessary issue in the corpus server)

Alternatives Considered:


Benefits:

  • Improved UX: Removes the friction of manually entering complex device specifications.
  • Enhanced Security: Allows users to audit their logins and log out of compromised or forgotten sessions remotely.
  • Better Data Quality: Automated detection provides more accurate and standardized hardware telemetry for the corpus data collection.

Risks or Concerns:


Test Cases:

  1. Auto-Detection: Log into the client app. Check the user profile and verify that the OS, Browser, RAM, CPU, and Internet Speed are correctly auto-populated without manual entry, leveraging the standard libraries.
  2. Multi-Device Login: Log in from Device A. Log in from Device B. On Device B, navigate to "Active Sessions" and verify that both Device A and Device B are listed with their correct OS/Browser details.
  3. Remote Sign Out: On Device B, click "Sign Out" next to Device A's session. Verify that Device A is immediately logged out and redirected to the login screen upon its next network request or page refresh.

Additional context or references: