specialtactics / laravel-api-boilerplate

Laravel API Boilerplate | Quickly build quality API products!
MIT License
490 stars 94 forks source link

Suggestion: Integrate Socialite auth into this package #24

Closed connecteev closed 5 years ago

connecteev commented 5 years ago

@specialtactics this isn't an issue per se, but I want to bring your attention to a codebase I've forked and gotten working that (might?) be good to integrate into this one.

Some context: My primary stack is nuxt (vue framework) for the frontend, talking to laravel apis. Check out a working version of laravel socialite with Nuxt.js here: https://github.com/connecteev/laravel-nuxt-authentication

Nuxt is amazing but if you don't care about the nuxt part, just ignore everything in the 'client' folder, and everything else should still work like a regular laravel app. I've tested Google, Twitter, Linkedin and Github auth and added detailed notes to the readme to the point where it is more or less dummy-proof.

2 ideas here:

  1. what if we combined these into one repo so it became an end-to-end working example of specialtactics/laravel5-api-boilerplate with nuxt?
  2. After the user is logged in, we could add authenticated API tokens/requests from the nuxt client, basically preventing unauthorized use of the API after login. For example: after a user logs in, the nuxt client would request data over Axios/Ajax for a logged-in user than no one else should be able to access

Not sure if any of this resonates but thought I'd mention.

specialtactics commented 5 years ago

Hey there @connecteev !

Thanks for your interest, I'm just on a holiday ATM so my replies may be far and few.

Basically, my vision for this project is very much for it to do only "one job", and do it well. I really don't want to bundle various other things into it, which are unrelated to backend APIs.

Beyond that, I also think that different concerns should live in different repositories, and I personally don't mix frontend/backend in the same repo.

However, I would love it, if there were sister projects which would a user could mix and match, for example - a vue/nuxt boilerplate for this laravel api boilerplate, as you would put it.

So my advise to you would be to just start a github project with such a purpose in mind, and if there's anything that would make your life easier, definitely raise it, and so long as it's generic enough, I can add it to this boilerplate :smile:

connecteev commented 5 years ago

Hey @specialtactics that makes sense, thanks for responding. I'll close this issue out in that case, and I'll let you know if I have any ideas for improving this boilerplate. Enjoy the vacation :)

specialtactics commented 5 years ago

Thanks @connecteev - I forgot to mention one more thing, if you do end up following this approach, please get in touch, and I would love to mention your project in the boilerplate's readme as well, so that people know where to go to if they want to match a frontend boilerplate to it :smile:

connecteev commented 5 years ago

@specialtactics will do, thanks