Vonage / vonage-node-sdk

Vonage API client for Node.js. API support for SMS, Voice, Text-to-Speech, Numbers, Verify (2FA) and more.
Apache License 2.0
375 stars 178 forks source link

feat(auth,messages,server-client): Made auth handlers async #801

Closed dragonmantank closed 1 year ago

dragonmantank commented 1 year ago

Description

Allow auth handlers to be overridden in case custom handlers need to be used

Motivation and Context

The video team needs an alternate way to get a JWT token, so this allows them to supply a custom auth handler. Expanded this to also work with the other non-JWT handlers as well to be consistent.

Messages also gets touched because it was the one case we overrode how to add auth to a request.

Testing Details

Unit tests

Example Output or Screenshots (if appropriate)

Types of changes

Checklist