Sending user ID to google analytics

Hi @jinnyzor, I’m currently using Basic Auth provided by the dash-auth package (you actually recommended I change to Flask-Login here Disable concurrent logins for Basic Auth).
I then accessed the username using

from Flask import request
username = request.authorization['username']

However, when I used this I had two issues. 1) this exposed the username when I checked the page source 2) the username it showed me wasn’t mine but someone else who was logged in. I could solve problem 1 using hashing or aliases but I’m not sure why I was getting issue two. Do you think Flask-Login would be more reliable?