Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expiry setting #31

Closed
TylerBarnes opened this issue Feb 23, 2019 · 6 comments
Closed

Expiry setting #31

TylerBarnes opened this issue Feb 23, 2019 · 6 comments

Comments

@TylerBarnes
Copy link
Collaborator

How long do tokens last until they expire? I see for the rest api JWT plugin there's a filter to increase the time before expiry. Does this plugin have something similar?

Thanks!

@jasonbahl
Copy link
Collaborator

Hey!!

Stoked to have you looking into WPGraphQL. The work you’ve been doing with WordPress and Gatsby is really cool!

I’m afk but will get you details shortly. Short answer is:

Refresh tokens are default as 1-year but can be revoked. Auth (access) tokens are 5 minutes by default, but cant be revoked.

You can filter the expiration though.

@TylerBarnes
Copy link
Collaborator Author

Thanks Jason, that's a really nice thing to say! I feel the same way about wp-graphql!
Thanks for the answer and definitely looking forward to the details!

Over the last few days I've been going over in my head how to swap out the "engine" of wordsby away from static json files towards wp-graphql instead.
I'm currently doing things like wordpress admin previews and live data from WP in gatsby but I can see how this would be a lot more reliable and easier to set up when paired with wp-graphql.
The graphql fields in gatsby would be identical to the ones in WP since gatsby-source-graphql does schema stitching and copies the api over. The query in gatsby page components could then easily be queried on the WP site from the browser to get live data.
A simple api for building things like password protected pages, user profiles, forums, and sending email from forms could be set up / built in gatsby which would be pretty cool!
I have a few questions about wp-graphql. Would the best place to ask be in the wp-graphql github issues or the slack channel?

@jasonbahl
Copy link
Collaborator

For general questions use Slack or Spectrum: https://spectrum.chat/wpgraphql

If you actually think you found a bug or have a feature request, open an issue.

For the sweet stuff you’re working on, like admin dashbords, etc, you should check out the Model Layer branch we have going on the main wp-graphql repo. We’re doing a lot of cleanup around permissions, capabilities, etc.

I’d love to chat more with you about your projects. I’ve been working on a dashboard as well, so we could definitely collaborate on that. One of my goals of WPGraphQL is to recreate the WP-Admin using React and have all the data come from WPGraphQL.

From what I’ve seen with your work with the Gatsby dashboards, you’ve got a very similar vision.

For me, building something like that will help finesse the shape of the Schema. Figure out what can/cannot be done with the existing Schema, where we’re missing features, etc.

Then I also want to recreate a full core theme (twentysixteen) or something to make sure WPGrapHQL is comprehensive enough for front-end devs too. I’m not far from that already with the Blog example I posted last week.

Anyway, excited to chat more with you!

@jasonbahl
Copy link
Collaborator

Hey, here's the filter for the expiration date:

https://github.com/wp-graphql/wp-graphql-jwt-authentication/blob/master/src/Auth.php#L114

@jasonbahl
Copy link
Collaborator

And the filter for the refresh token expiration: https://github.com/wp-graphql/wp-graphql-jwt-authentication/blob/master/src/Auth.php#L316

@TylerBarnes
Copy link
Collaborator Author

I'd love to collaborate on an admin dashboard! That would be pretty awesome if the whole front and backend of WP was just react and graphql. That could really bring WP into the present/future. All those plans and the model layer sound really great.
I'll send you a message on slack soon to talk more.

Also, thanks for pointing out where those filters are. In retrospect it would've been pretty to easy for me to just look through the source but I appreciate you pointing it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants