Error making method call inside cypress orgin command

I’m getting the following error attempting to automate my login procedure into a page object.

this.signIn is not a function

Here is my page object:

export class OktaLoginPage {
  oktaServer = Cypress.env('oktaServer'); 

  get oktaServer() {
    return this.oktaServer;
  }

  set oktaServer(server) {
    this.oktaServer = server;
  }

  login(username, password) {
    const loginArgs = {username: username, password: password};
    if (this.domainsMatch(this.oktaServer)) {
      this.signIn(username, password);
    } else {
      cy.origin(this.oktaServer, {args: loginArgs}, ({username, password}) => {
        this.signIn(username, password);
      })
    }
  }

  signIn(username, password) {
    cy.contains('h2', 'Sign In');
    cy.get('input[name="username"]').clear();
    cy.get('input[name="username"]').type(username);
    cy.get('input[type="submit"]').invoke('attr', 'value').then(btnValue => {
      if (btnValue === 'Next') {
        cy.get('input[type="submit"]').click();
      }
    });
    cy.get('input[type="password"]').clear().type(password);
    cy.get('input[type="submit"]').click();
  }

    // domainsMatch not shown
}

If I copy the code from the signIn method into the cy.orgin block it works fine. There is some issue with making a class method call inside an origin block. The cypress docs indicate that I must define the class/object within the origin block. I’ve tried a few different ways to get this to work including:

const OktaLoginPage = Cypress.require('../../support/page-objects/oktaLogin.po');
const login = new OktaLoginPage();
login.signIn(username, password);

Need some assistance with this. thanks.