candy-api: Unable to login to hub, API responds with "Call to a member function encodedId() on null""

Hello, when logging in to the HUB I encounter the following error:

on endpoint: /api/v1/users/current?includes=roles.permissions,details

{message: "Call to a member function encodedId() on null", exception: "Error",…}
exception: "Error"
file: "/var/www/candy/foodui/vendor/getcandy/candy-api/src/Http/Controllers/Users/UserController.php"
line: 77
message: "Call to a member function encodedId() on null"
trace: [,…]

image

Expected Behavior

I should be able to login, I followed this guide: https://guides.getcandy.io/getting-started/hub/authentication/#laravel-sanctum

Possible Solution

Investigating still.

Steps to Reproduce

  1. Setup GetCandy (Clean install), create user, migrate, seed, etc
  2. Follow the this guide https://guides.getcandy.io/getting-started/hub/authentication/#laravel-sanctum
  3. Setup the hub, configure your .env
  4. try to login.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Thanks for your input on this @Repox since this bug is breaking things for people putting the routes in the api.php file I’ll get a release tagged now.