Headless API user login #6429
-
I'm looking to build a Nuxt application with Statamic as back-end coming from Strapi but my only concern is: is it easy enough to implement a system that allows people to register and access restricted content? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @99michel99, From what I understand there are multiple ways you could achieve this. First a heads-up: Statamic's APIs (REST and GraphQL) don't offer built-in authentication right now. See here and here. You could do your auth either on the backend (Statamic/Laravel) or a more frontend heavy approach in your Nuxt application. Depends on your preference. With Laravel it's quite easy to come up with your own solution by leveraging it's great ecosystem of (first-party) packages, like Laravel Sanctum or Laravel Passport. Sanctum is a more lightweight solution and Passport a full-fledged OAuth2 server. There is also the Nuxt Auth module that offers support for Laravel Sanctum, Laravel Passport and Laravel JWT. You could even use an external auth provider like Auth0. Also have a look at the awesome Memberbox addon by @jacksleight. Don't know of how much use it is to you in your use case though but maybe it gives you a head start. Hope that helps 🚀 |
Beta Was this translation helpful? Give feedback.
Hey @99michel99,
From what I understand there are multiple ways you could achieve this.
First a heads-up: Statamic's APIs (REST and GraphQL) don't offer built-in authentication right now. See here and here.
You could do your auth either on the backend (Statamic/Laravel) or a more frontend heavy approach in your Nuxt application. Depends on your preference.
With Laravel it's quite easy to come up with your own solution by leveraging it's great ecosystem of (first-party) packages, like Laravel Sanctum or Laravel Passport. Sanctum is a more lightweight solution and Passport a full-fledged OAuth2 server.
There is also the Nuxt Auth module that offers support for Laravel Sanctum, Laravel Passport