Refactor user authentication flow

In ProgressSat Oct 05 2024

Current authentication flow is complex and error-prone. Refactor to simplify and use JWT tokens for session management.