Enhanced JS user authentication