Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

Incorrect error message #89

@curiousercreative

Description

@curiousercreative

Because the below code has an invalid scope (SCOPES.ACCOUNTS_WRITE), we have an error thrown, but the message "TypeError: one or more scopes are required" does not seem appropriate.

const { Moov } = require('@moovio/node');

const moov = new Moov({
  accountID: process.env.MOOV_ACCOUNT_ID,
  domain: process.env.MOOV_DOMAIN,
  publicKey: process.env.MOOV_PUB_KEY,
  secretKey: process.env.MOOV_PRIVATE_KEY,
});

const scopes = [
  SCOPES.ACCOUNTS_WRITE,
  SCOPES.CARDS_WRITE,
];

(async () => {
  const token = await moov.generateToken(scopes);
})();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions