Moved whoami from dynamic javascript file to api service to avoid login
workflow unwanted side effect (redirect to whoami.js after successful
login for instance).