Language: TypeScript
Label: safe
CWE: CWE-522 \u2014 Insufficiently Protected Credentials
The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.

Code:
    constructor(username: string, password: string, allowCrossOriginAuthentication?: boolean) {
        this.username = username;
        this.password = password;
        this.allowCrossOriginAuthentication = allowCrossOriginAuthentication;
    }