0

I am creating small project in Laravel. I made a small CMS based on vue.js (it is component based SPA application) and now I (as Admin) want to insert manually users to database (username, email, password, and boolean isAdmin) from vue's component.

And questions is how can I do that in secure way?

1
  • What did you try? Commented Aug 18, 2017 at 14:17

1 Answer 1

1

I've been using vue-auth to handle this in my projects. It injects itself into requests and responses through vue-resource or axios HTTP client and allows for various authentication schemes. JWT is one popular option, I use bearer authentication.

I use Rails for my APIs so I can't give advice on the Laravel end of things, but the basic flow is -

  1. Vue client POSTS login request
  2. Server responds OK and sends back JWT, bearer token, or some other payload for the client
  3. Vue-auth processes this response and then injects it into future requests to the server, authorizing the request
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.