Skip to content

Commit 27f64d5

Browse files
WeksikpolRk
authored andcommitted
fix: fixed database connection URL
Removed the @ensureContext(true) decorator from the login method as it was breaking the request object, preventing authentication in YDB. In the Driver class constructor, replaced `origin` with `host`, as `origin` returned `null`, which caused the database connection to fail.
1 parent 8111762 commit 27f64d5

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/credentials/static-credentials-auth-service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class StaticCredentialsGrpcService extends GrpcService<Ydb.Auth.V1.AuthService>
3333
super(endpoint, 'Ydb.Auth.V1.AuthService', Ydb.Auth.V1.AuthService, sslCredentials);
3434
}
3535

36-
@ensureContext(true)
3736
@retryable()
3837
login(request: Ydb.Auth.ILoginRequest) {
3938
return this.api.login(request);

src/driver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default class Driver {
7777

7878
if (settings.connectionString) {
7979
let cs = new URL(settings.connectionString);
80-
endpoint = cs.origin;
80+
endpoint = cs.host;
8181
database = cs.pathname || cs.searchParams.get('database') || '';
8282

8383
if (!database) {

0 commit comments

Comments
 (0)