UNPKG

@symanticreative/vendure-admin-client

Version:

A TypeScript GraphQL client for Vendure Admin API to create custom dashboards

51 lines 1.85 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Injectable } from '../core/di/injectable.decorator'; /** * Service for authentication operations */ let AuthService = class AuthService { constructor(authRepository) { this.authRepository = authRepository; } /** * Login to the Vendure Admin API * @param credentials - Authentication credentials * @returns Promise resolving to auth response */ async login(credentials) { return this.authRepository.login(credentials); } /** * Logout from the Vendure Admin API * @returns Promise resolving to void */ async logout() { return this.authRepository.logout(); } /** * Get the current authenticated user * @returns Promise resolving to current user */ async getCurrentUser() { return this.authRepository.getCurrentUser(); } /** * Check if the user is authenticated * @returns Boolean indicating if authenticated */ isAuthenticated() { // This would typically check token validity, expiration, etc. // For now, we'll just return a placeholder return true; // Placeholder } }; AuthService = __decorate([ Injectable() ], AuthService); export { AuthService }; //# sourceMappingURL=auth.service.js.map