LaravelDaily / Laravel-Vue-First-CRUD

Simple demo project for Laravel 5.5 and Vue.js with one CRUD operation.
256 stars 156 forks source link

add simple token auth for api (random string) #5

Open Freeongoo opened 6 years ago

Freeongoo commented 6 years ago

Because it's a bad idea to leave api open for everyone, so that everyone can edit the list of companies :)

ModestasV commented 6 years ago

@Freeongoo Wouldn't passport be better here? I mean, your implementation is allright but installing passport - would do most of the stuff you are doing.

See links: https://laravel.com/docs/5.6/passport https://laravel.com/docs/5.6/passport#consuming-your-api-with-javascript

Freeongoo commented 6 years ago

@ModestasV, yes i know, but this is simple project and simple auth, IMHO

PovilasKorop commented 6 years ago

@Freeongoo actually Laravel Passport is really simple. I intentionally left this outside, cause people can implement Auth thing however they want, with Passport or JWT or whatever. This is outside of the scope of this project.

Freeongoo commented 6 years ago

@PovilasKorop ok

ModestasV commented 6 years ago

@Freeongoo Just don't feel discouraged - we do see the good in what you did and honestly, I would leave this pull request for people to see the possible implementation! It is a nice job on showing how this could be done in few simple steps :)