-
Notifications
You must be signed in to change notification settings - Fork 292
Open
Description
I'm trying to use CredentialsEncodingMode.LOOSE, as follows:
import {ClientCredentials, AccessToken, CredentialsEncodingMode} from "simple-oauth2";
...
this.oauth2 = new ClientCredentials(
{
client: {
id: username,
secret: password,
},
auth: {
tokenHost: this.HOST,
tokenPath: "/authentication/api/token",
},
options: {
credentialsEncodingMode: CredentialsEncodingMode.LOOSE,
},
}
);
and I get a runtime error
TypeError: Cannot read properties of undefined (reading 'LOOSE')
I'm not an expert in how typescript works, but according to https://ncjamieson.com/dont-export-const-enums/ this is an inherent limitation of exporting a const enum.
I am using the following as a workaround:
// @ts-ignore
credentialsEncodingMode: "loose",
maybe the exported enums should be non-const?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels