Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
fix(subscriptions): only call securityService.onSubscriptionConnect w…
Browse files Browse the repository at this point in the history
…hen securityService is present
  • Loading branch information
Dara Hayes committed May 16, 2019
1 parent 77299e0 commit 06aee3f
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ export class VoyagerSubscriptionContextProvider {
}

private async getDefaultContext(connectionParams: any, webSocket: any, context: any): Promise<any> {
const auth = await this.securityService.onSubscriptionConnect(connectionParams, webSocket, context)
const defaultContext = {
auth
if (this.securityService) {
const auth = await this.securityService.onSubscriptionConnect(connectionParams, webSocket, context)
const defaultContext = {
auth
}
return defaultContext
}
return defaultContext
}
}

Expand Down

0 comments on commit 06aee3f

Please sign in to comment.