TylerBarnes / wordsby

A toolset to glue Gatsby and WordPress together
65 stars 4 forks source link

Add User Authentication #38

Open ghost opened 5 years ago

ghost commented 5 years ago

If possible, can you add user authentication as well? A login page asking users to login to see certain pages

TylerBarnes commented 5 years ago

@LittleHamster this is something I've been thinking about and I would like to support it. Probably it will be a small number of functions and a form. Most likely it will use json web tokens and this plugin will be required when using the functionality -> https://wordpress.org/plugins/jwt-authentication-for-wp-rest-api/.

I like this idea because gatsby could easily be used for woocommerce orders. https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction

TylerBarnes commented 5 years ago

One more thing, I think for having protected pages they will have to have empty data during the build and pull live rest api data when authenticated. This shouldn't be a problem since wordsby already has an "instant publish" feature that pulls live rest api data during builds (so the front end always has the latest data). That feature will need to be completed before adding this feature since instant publish doesn't currently support menus, options, or archive pages.