Basic authentication token generation bug fix