How to pass the variable password to the other functions in typescript?

I have implemented a login API and I want to use the password variable in other functions where I need to log that password. Like that status Service I have other 7 similar functions that should be logged. I tried by initializing the variable globally and try to use it later but not worked. Can anyone give any ideas on how to pass the variable to other functions in typescript or in javascript please.

@injectable()
export class IngestionService {
  @inject(TYPES.IngestionRepository)
  private ingestionRepository: IngestionRepository;

public async loginService(request, response) {
    try {
      let userDetails: any = await this.ingestionRepository.loginCheck(request.body);
      var email=request.body.emailid;
      var password=request.body.password;
      if (userDetails.rows.length === 0) {
        let wrongEmailResponse ={
          status: "Error",
          message: "The email "+email+" is not found in our database. So please enter the correct email address"
        }
        response.status(500).send(wrongEmailResponse);
      } else {
        let crypted = await this.authenticateUser.getEncryptedpassword(request.body.password);
        request.body.password = crypted;
        console.log(crypted);
        console.log(typeof userDetails.rows[0].userpassword)
        if(userDetails.rows[0].userpassword.match(crypted)){
          
          let responseData={
            status: "Success",
            message: "You have logged in successfully"
          }
          response.status(200).send(responseData);
        }
        else{
          let wrongPassResp={
            status: "Error",
            message: "You have entered wrong password"
          }
          response.status(500).send(wrongPassResp);
        }
      }
    //  return password;
    }
    catch (err) {
      let message = { message: err.message };
      response.status(500).send(message);
    }
  }



  public async statusService(request, response) {
    try {
      let ids = getid(request);
      var [msg]: any = await this.checkId.id(request, response);
      if (msg === true) {
        await this.ingestionRepository
          .getAssetStatusRepository({
            assetid: assetids,
            columns: request.query.columns,
          })
          .then((data: any) => {
            data.forEach((element) => {
              this.dateConversion(element);
            });
            let responseData = {
              status: "Success",
              message: "Below are the asset details",
              data: data
            };
            response.status(200).send(responseData);

          });
      }
    } catch (err) {
      let message = { message: err.message };
      response.status(500).send(message);
      //mongoResponse.error_message = message;
    }
  }