src/Api/Api/Api.php
protected function getToken(): string
    {
        if (!$this->token) {
            $username = $this->configService->get('ds_api.user.username');
            $payload = [
                'uuid' => $this->configService->get('ds_api.user.uuid'),
                'roles' => $this->configService->get('ds_api.user.roles'),
                'identity' => (object) [
                    'roles' => $this->configService->get('ds_api.user.identity.roles'),
                    'type' => $this->configService->get('ds_api.user.identity.type'),
                    'uuid' => $this->configService->get('ds_api.user.identity.uuid')
                ],
                'tenant' => $this->configService->get('ds_api.user.tenant')
            ];
            $user = User::createFromPayload($username, $payload);
            $this->token = $this->tokenManager->create($user);
        }

        return $this->token;
    }
protected function getToken(): string
    {
        if (!$this->token) {
            $username = $this->configService->get('ds_api.user.username');
            $payload = [
                'uuid' => $this->configService->get('ds_api.user.uuid'),
                'roles' => $this->configService->get('ds_api.user.roles'),
                'identity' => (object) [
                    'roles' => $this->configService->get('ds_api.user.identity.roles'),
                    'type' => $this->configService->get('ds_api.user.identity.type'),
                    'uuid' => $this->configService->get('ds_api.user.identity.uuid')
                ],
                'tenant' => $this->configService->get('ds_api.user.tenant')
            ];
            $user = User::createFromPayload($username, $payload);
            $this->token = $this->tokenManager->create($user);
        }

        return $this->token;
    }
protected function getToken ( ) : string { if ( ! $ this -> token ) { $ username = $ this -> configService -> get ( 'ds_api.user.username' ) ; $ payload = [ 'uuid' => $ this -> configService -> get ( 'ds_api.user.uuid' ) , 'roles' => $ this -> configService -> get ( 'ds_api.user.roles' ) , 'identity' => ( object ) [ 'roles' => $ this -> configService -> get ( 'ds_api.user.identity.roles' ) , 'type' => $ this -> configService -> get ( 'ds_api.user.identity.type' ) , 'uuid' => $ this -> configService -> get ( 'ds_api.user.identity.uuid' ) ] , 'tenant' => $ this -> configService -> get ( 'ds_api.user.tenant' ) ] ; $ user = User :: createFromPayload ( $ username , $ payload ) ; $ this -> token = $ this -> tokenManager -> create ( $ user ) ; } return $ this -> token ; }
Get token

@return string
Get token