dimanche 4 juin 2017

Laravel 5 Auth:api middleware

I have the auth with api_token for api request so have a few users

users: [
  {
    id: 1,
    name: "Joe",
    api_token: SomeRandomString,
    ...
  }
  {
    id: 2,
    name: "Steve",
    api_token: SomeRandomString,
    ...
  }
]

maybe it's a magic but If I request data with a Joe api_token returned

"potables": [
  {
    "id": 8,
    "name_ru": "тест",
    "name_en": " test",
    "img_path": "/menu/2016/09/22/кофе.jpg",
    "price": 400,
    "type": "potables"
  },
  {
    "id": 10,
    "name_ru": "Кофе",
    "name_en": "Coffe",
    "img_path": "/menu/SQm8mF/кофе.jpg",
    "price": 400,
    "type": "potables"
  }
]

if i using Steve api_token

"potables": 
  {
    "id": 10,
    "name_ru": "Кофе",
    "name_en": "Coffe",
    "img_path": "/menu/SQm8mF/кофе.jpg",
    "price": 400,
    "type": "potables"
  }

why?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qQb6xT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire