UNPKG

@citrineos/base

Version:

The base module for OCPP v2.0.1 including all interfaces. This module is not intended to be used directly, but rather as a dependency for other modules.

46 lines 1.22 kB
"use strict"; /* * // Copyright Contributors to the CitrineOS Project * // * // SPDX-License-Identifier: Apache 2.0 * */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiAuthenticationResult = void 0; /** * Result of authentication process */ class ApiAuthenticationResult { constructor() { /** * Whether authentication was successful */ this.isAuthenticated = false; } /** * Creates a new successful authentication result * * @param user Authenticated user information * @returns Authentication result */ static success(user) { const result = new ApiAuthenticationResult(); result.isAuthenticated = true; result.user = user; return result; } /** * Creates a new failed authentication result * * @param error Error message * @returns Authentication result */ static failure(error) { const result = new ApiAuthenticationResult(); result.isAuthenticated = false; result.error = error; return result; } } exports.ApiAuthenticationResult = ApiAuthenticationResult; //# sourceMappingURL=ApiAuthenticationResult.js.map