Skip to content

Commit

Permalink
instance
Browse files Browse the repository at this point in the history
  • Loading branch information
TPVallancourt committed Oct 30, 2024
1 parent 8db7c47 commit 08f8110
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ export interface ConnectionOptions {
interface RoutingData {
server: string;
port: number;
login7server: string;
instance: string;
}

/**
Expand Down Expand Up @@ -2485,7 +2485,7 @@ class Connection extends EventEmitter {
}

payload.hostname = this.config.options.workstationId || os.hostname();
payload.serverName = this.routingData ? this.routingData.login7server : this.config.server;
payload.serverName = this.routingData ? `${this.routingData.server}\\${this.routingData.instance}` : this.config.server;
payload.appName = this.config.options.appName || 'Tedious';
payload.libraryName = libraryName;
payload.language = this.config.options.language;
Expand Down
6 changes: 3 additions & 3 deletions src/token/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class Login7TokenHandler extends TokenHandler {
declare connection: Connection;

declare fedAuthInfoToken: FedAuthInfoToken | undefined;
declare routingData: { server: string, port: number, login7server: string } | undefined;
declare routingData: { server: string, port: number, instance: string } | undefined;

declare loginAckReceived: boolean;

Expand Down Expand Up @@ -337,10 +337,10 @@ export class Login7TokenHandler extends TokenHandler {

onRoutingChange(token: RoutingEnvChangeToken) {
// Removes instance name attached to the redirect url. E.g., redirect.db.net\instance1 --> redirect.db.net
const [ server ] = token.newValue.server.split('\\');
const [ server, instance ] = token.newValue.server.split('\\');

this.routingData = {
server, port: token.newValue.port, login7server: token.newValue.server
server, port: token.newValue.port, instance
};
}

Expand Down

0 comments on commit 08f8110

Please sign in to comment.