Skip to content

Commit

Permalink
refactor: SENT_TLSSSLNEGOTIATION switch statement
Browse files Browse the repository at this point in the history
  • Loading branch information
mShan0 committed May 16, 2022
1 parent 41d99bf commit cb8376c
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/connection.ts
Expand Up @@ -3310,12 +3310,21 @@ Connection.prototype.STATE = {
this.sendLogin7Packet();

const { authentication } = this.config;
if (authentication.type === 'azure-active-directory-password' || authentication.type === 'azure-active-directory-msi-vm' || authentication.type === 'azure-active-directory-msi-app-service' || authentication.type === 'azure-active-directory-service-principal-secret' || authentication.type === 'azure-active-directory-default') {
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_FEDAUTH);
} else if (authentication.type === 'ntlm') {
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_NTLM);
} else {
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN);

switch (authentication.type) {
case 'azure-active-directory-password':
case 'azure-active-directory-msi-vm':
case 'azure-active-directory-msi-app-service':
case 'azure-active-directory-service-principal-secret':
case 'azure-active-directory-default':
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_FEDAUTH);
break;
case 'ntlm':
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_NTLM);
break;
default:
this.transitionTo(this.STATE.SENT_LOGIN7_WITH_STANDARD_LOGIN);
break;
}
})().catch((err) => {
process.nextTick(() => {
Expand Down

0 comments on commit cb8376c

Please sign in to comment.