How to consume authenticated API in Laravel with VueJS?

2

I need to consume an API with VueJs in Laravel 5.2, but is it authenticated, any tips for this process?

    
asked by anonymous 07.07.2016 / 21:48

1 answer

4

It is not common for an API to use traditional session authentication. What you usually have as protection is an OAuth server or JSON Web Token authentication.

If the form of authentication can not be modified, then its Vue components need to be served through the Laravel routes along with Laravel's own views, all after the user authenticates in the application. From there any API call would not be barred by authentication, which has already been done and the logged in user is in the Session.

In this case you would have a hybrid application.

    
08.07.2016 / 01:12