Code Monkey home page Code Monkey logo

Comments (11)

krisanalfa avatar krisanalfa commented on August 15, 2024

Could you please copy-paste your cURL request + response here?

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

Here it is man @krisanalfa

screen shot 2017-05-31 at 3 46 06 pm

from lumen-jwt.

krisanalfa avatar krisanalfa commented on August 15, 2024

Have you done any authentication request before accessing refresh endpoint?

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

@krisanalfa Yes. Else, i will be receiving different error if not authenticated right?

I've tried to take out this route outside the middleware and it works fine. But will it be the best practice?

$api->patch('/auth/refresh', [
'uses' => 'App\Http\Controllers\Auth\AuthController@patchRefresh',
'as' => 'api.auth.refresh']);

from lumen-jwt.

krisanalfa avatar krisanalfa commented on August 15, 2024

No. You should use auth middleware for refresh endpoint. Because any refreshed token should be a valid token, it represents a single session for a user. Mine is working here.

After you logged in, can you access /api/auth/user endpoint?

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

Yeah, all endpoints are working fine so long as token still valid. But the moment it expired, I can't able to refresh the token.

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

Let me know if you want the steps to reproduce this

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

@krisanalfa does the refresh endpoint is working on your end when you pass an expired token?

from lumen-jwt.

krisanalfa avatar krisanalfa commented on August 15, 2024

No. Refreshed token should be a valid token. Which is expired token would be rejected.

from lumen-jwt.

pmventura avatar pmventura commented on August 15, 2024

Hmm, i see. But I believe you don't want the user to re-authenticate(bring back to login) if the token expired right? Should just refresh and you'll get a new access token.

from lumen-jwt.

krisanalfa avatar krisanalfa commented on August 15, 2024

Yeah, you need to re-login before refreshing the token (only if you got token expired).

from lumen-jwt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.