A
A
Amenov_Abdul2019-11-04 13:21:22
Vue.js
Amenov_Abdul, 2019-11-04 13:21:22

How to get to the admin panel with JWT in conjunction with Nuxt.js?

Hello!
I don't know how to say all this, I'm confused myself.
I finally did the authorization and registration with the receipt of the JWT token.
This response comes:

{
    "access_token": "мой токен....",
    "token_type": "bearer",
    "expires_in": 3600
}

Now I need to get into the admin panel on the front-end, how to implement it correctly?
In the case of a personal account, I made middleware for the presence of a token in vuex

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arthur Mustafin, 2019-11-04
@virtual_hack2root

Just add an Authorization header so that requests are authorized on both the server and the client.
Authorization: Bearer <token>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question