Skip to content

Commit 38b498c

Browse files
committed
make auth provider configurable
1 parent 2e22c8f commit 38b498c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/DBSQLClient.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient {
8484
* Connects DBSQLClient to endpoint
8585
* @public
8686
* @param options - host, path, and token are required
87+
* @param authProvider - Optional custom authentication provider
8788
* @returns Session object that can be used to execute statements
8889
* @example
8990
* const session = client.connect({host, path, token});
9091
*/
91-
async connect(options: ConnectionOptions): Promise<IDBSQLClient> {
92-
this.authProvider = new PlainHttpAuthentication({
92+
async connect(options: ConnectionOptions, authProvider?: IAuthentication): Promise<IDBSQLClient> {
93+
this.authProvider = authProvider || new PlainHttpAuthentication({
9394
username: 'token',
9495
password: options.token,
9596
headers: {

0 commit comments

Comments
 (0)