DivanteLtd / coreshop-vsbridge

CoreShop Vue Storefront integration - first Progressive Web App (PWA) framework for Pimcore
https://vuestorefront.io
MIT License
74 stars 25 forks source link

Error when try to get current user #25

Open turgic opened 5 years ago

turgic commented 5 years ago

I created a new api :

/**
     * @Route("/vsbridge/product/get/{product}")
     * @Method("GET")
     *
     * @param Request           $request
     *
     * @return JsonResponse
     */
    public function getProduct(
        Request $request
    ) {
        $user = $this->getUser();

        return $this->json([
            'status' => 200,
            'result' => $user,
        ]);
    }

But I get the error :

Call to a member function isAdmin() on null (500 Internal Server Error)

I confirm that first I called the login method, and with the token from /login I call this new api. You have an idea @pkarw, @kwreczycki ? thx in advance

dkarlovi commented 3 years ago

@turgic can you provide a stacktrace?