Skip to main content

TokenAuth

Upgather SDK


Upgather SDK / TokenAuth

Class: TokenAuth

Defined in: lib/auth/TokenAuth.ts:11

Provides a token-based authentication strategy.

Remarks

This class implements the AuthStrategy interface and applies a token to an HTTP request for authentication purposes.

Implements

Constructors

new TokenAuth()

new TokenAuth(token): TokenAuth

Defined in: lib/auth/TokenAuth.ts:20

Creates an instance of TokenAuth.

Parameters

token

string

The authentication token.

Returns

TokenAuth

Methods

authenticate()

authenticate(request): void

Defined in: lib/auth/TokenAuth.ts:29

Applies the token to the HTTP request.

Parameters

request

HttpRequest

The HTTP request to authenticate.

Returns

void

Implementation of

AuthStrategy.authenticate