UNPKG

@capawesome/cli

Version:

The Capawesome Cloud Command Line Interface (CLI) to manage Live Updates and more.

16 lines (15 loc) 539 B
import userConfig from '../utils/user-config.js'; class AuthorizationServiceImpl { userConfig; constructor(userConfig) { this.userConfig = userConfig; } getCurrentAuthorizationToken() { return this.userConfig.read().token || process.env.CAPAWESOME_CLOUD_TOKEN || process.env.CAPAWESOME_TOKEN || null; } hasAuthorizationToken() { return !!this.getCurrentAuthorizationToken(); } } const authorizationService = new AuthorizationServiceImpl(userConfig); export default authorizationService;