jonathan-dejong / simple-jwt-authentication

Extends the WP REST API using JSON Web Tokens Authentication as an authentication method.
GNU General Public License v3.0
87 stars 25 forks source link

Refresh token #19

Closed garymould closed 5 years ago

garymould commented 6 years ago

Great work. I had a few issues with the Tmeister plugin which have been solved here (e.g. token expiry).

Is there a way to refresh a token, e.g. if a token is valid for 30 days and the user uses the app on the 29th day it should extend/reset to 30 days?

jonathan-dejong commented 6 years ago

Hi @garymould

Currently there's no way to do that I'm afraid. But I'm happy to accept pull requests with new features :)

garymould commented 6 years ago

Thanks for the reply @jonathan-dejong.

I'll see what I can do. I cannot seem to get the resetpassword endpoint working - I was wondering if this could be a good starting point?

jonathan-dejong commented 6 years ago

I don't think it'll help you much. It's just a custom endpoint which basically copies the function WordPress core has to reset a password.

Hope you've made some progress on your own :) I've just gotten back from parental leave.

florent-huran commented 6 years ago

There is a fork here of the original plug-in which seems to have included regeneration function: https://github.com/ssuess/wp-api-jwt-auth

qazsero commented 5 years ago

45

I don't know how many people use this plugin but it has been handy to me creating my reactjs frontend using wordpress as an api.

I created a PR that has the new endpoint, happy and sad path tested, works for me.

jonathan-dejong commented 5 years ago

Hi @qazsero Thank you for the PR! It's great to see other contribute to OS as well!

I'll take a look and probably merge it right away :)

jonathan-dejong commented 5 years ago

Yep, looks good :) This will solve the initial issue so I'm closing this as well..

I might refactor some of the code for DRY later but as it is it should work great. thanks again.