• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

JWT Authentication API responded {"error":"Unauthenticated"}

General Discussion
2
3
1.1k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R
    rudiculous last edited by 13 Jul 2021, 05:47

    I called

    POST http(s)://example.com/api/customer/login?token=true
    

    alt text

    THen I tried to call API, I got {"error":"Unauthenticated"}

    GET <host>/api/customer/get
    

    alt text

    What did I miss?

    Thanks!

    1 Reply Last reply Reply Quote 0
    • devansh-webkul
      devansh-webkul last edited by 13 Jul 2021, 06:27

      Just add ?token=true in each request.

      1 Reply Last reply Reply Quote 0
      • R
        rudiculous last edited by 13 Jul 2021, 06:46

        @devansh-webkul said in JWT Authentication API responded {"error":"Unauthenticated"}:

        ?token=true

        YES! Thank you! It works now.
        But before it can work, I need to do this first:

        php artisan key:generate
        php artisan jwt:secret
        php artisan cache:clear
        php artisan config:clear
        
        1 Reply Last reply Reply Quote 0
        2 out of 3
        • First post
          2/3
          Last post