Class

AuthGrpcService

AuthGrpcService(accessToken)

Auth gRPC Service

Constructor

# new AuthGrpcService(accessToken)

Constructor

Parameters:
Name Type Description
accessToken string

The access token to authenticate the client.

View Source services/auth.service.js, line 11

Classes

AuthGrpcService

Methods

# authInterceptor(token) → {function}

Creates a gRPC interceptor to add an authorization token to request metadata.

Parameters:
Name Type Description
token string | null

The Bearer token to attach to outgoing gRPC requests. If null, no authorization header is added.

View Source services/auth.service.js, line 42

A gRPC interceptor function that can be used with gRPC clients.

function

# async getUserById(userId) → {Promise.<User>}

Fetches a user by ID via the Auth gRPC service.

Parameters:
Name Type Description
userId string

The unique identifier of the user to fetch.

View Source services/auth.service.js, line 61

If the user is not found or if the gRPC request fails.

Error
  • The user object corresponding to the given ID.
Promise.<User>