Skip to main content

Function: setToken()

function setToken(cluster: string, token: string | null): Promise<void> | Promise<boolean>;

Defined in: lib/auth.ts:108

Sets or updates the token for a given cluster using cookie-based storage. The token is stored securely in an HttpOnly cookie on the backend.

Parameters

ParameterTypeDescription
clusterstringThe name of the cluster.
tokenstring | nullThe authentication token to set. Pass null to clear the token.

Returns

Promise<void> | Promise<boolean>

Throws

When cluster name is invalid or backend request fails