Skip to content

Script not exiting when using AuthUserPasswordCredentials #30

@databyjp

Description

@databyjp

When running the exact same script, instantiating the client with AuthUserPasswordCredentials leads to the script not exiting upon completion. For example:

import weaviate, { WeaviateClient } from 'weaviate-ts-client';

const client: WeaviateClient = weaviate.client({
  scheme: "https",
  host: "<wcs instance w OIDC>",
  authClientSecret: new weaviate.AuthUserPasswordCredentials({
    username: "<email>",
    password: "<password>",
  })
});

client
  .schema
  .getter()
  .do()
  .then((res: any) => {
    console.log(res);
  })
  .catch((err: Error) => {
    console.error(err)
  });

Causes it to hang at completion (running with ts-node), whereas authenticating with the API key will work just fine:

import weaviate, { WeaviateClient } from 'weaviate-ts-client';

const client: WeaviateClient = weaviate.client({
  scheme: "https",
  host: "<the same wcs instance w OIDC>",
  headers: {"Authorization": "Bearer <API key>"}
});

client
  .schema
  .getter()
  .do()
  .then((res: any) => {
    console.log(res);
  })
  .catch((err: Error) => {
    console.error(err)
  });

Note: This behaviour (hanging) does not occur when using a WCS instance without authentication turned on, either.

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