PHP 8.2.30
Preview: errors.ts Size: 1.07 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/@adminjs/express/src/errors.ts

export const MISSING_AUTH_CONFIG_ERROR =
  'You must configure either "authenticate" method or assign an auth "provider"';
export const INVALID_AUTH_CONFIG_ERROR =
  'You cannot configure both "authenticate" and "provider". "authenticate" will be removed in next major release.';

export class WrongArgumentError extends Error {
  constructor(message: string) {
    super(message);
    this.name = "WrongArgumentError";
  }
}

export class OldBodyParserUsedError extends Error {
  constructor(
    message = `
  You probably used old \`body-parser\` middleware, which is not compatible
  with @adminjs/express. In order to make it work you will have to
  1. move body-parser invocation after the AdminJS setup like this:
  
  const adminJs = new AdminJS()
  const router = new buildRouter(adminJs)
  app.use(adminJs.options.rootPath, router)
  
  // body parser goes after the AdminJS router
  app.use(bodyParser())
  
  2. Upgrade body-parser to the latest version and use it like this:
  app.use(bodyParser.json())
  `
  ) {
    super(message);
    this.name = "WrongArgumentError";
  }
}

Directory Contents

Dirs: 2 × Files: 7

Name Size Perms Modified Actions
- drwxr-xr-x 2026-02-28 00:29:10
Edit Download
typings DIR
- drwxr-xr-x 2026-02-28 00:28:58
Edit Download
3.17 KB lrw-r--r-- 2026-02-28 00:28:46
Edit Download
3.57 KB lrw-r--r-- 2026-02-28 00:28:50
Edit Download
120 B lrw-r--r-- 2026-02-28 00:28:54
Edit Download
1.07 KB lrw-r--r-- 2026-02-28 00:28:58
Edit Download
3.75 KB lrw-r--r-- 2026-02-28 00:29:00
Edit Download
245 B lrw-r--r-- 2026-02-28 00:29:00
Edit Download
1.12 KB lrw-r--r-- 2026-02-28 00:29:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).