I
I
igor11122018-12-29 02:05:53
Laravel
igor1112, 2018-12-29 02:05:53

SPA vue & laravel?

When writing SPA vue&laravel, can I do standard authentication/authorization via cookies and sessions, or is this considered bad manners? Or should it be a mandatory stateless application using all sorts of jwt, laravel passport?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex Wells, 2018-12-29
@igor1112

You can, but there are some nuances:
- you don't always need the web version, sometimes you only need data. In this case, the use of cookies is not a very pleasant thing, especially if it is not sharpened for this (and most things are not sharpened))
- when the fronter wants to test the front under different accounts, having only social. authorization, he will strongly want some kind of token authorization)
- for the server socket, if implemented correctly, the user is not needed, only his reliable id. I don’t know how oauth (passport) is, but jwt can definitely provide it without an extra overhead
. Otherwise, cookies are just as good an option, and even better if you don’t need external authorization (authorization using your product)

S
Sergey, 2018-12-29
@gangstarcj

Better through passport. After the spa, you will want a mobile application, and it is better to work with it through tokens.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question