M
M
MeMoJlor2021-12-04 20:40:50
Backend
MeMoJlor, 2021-12-04 20:40:50

Vue admin login page?

Good evening. Let's say I want to write an admin front in Vue. The question immediately arises: is it possible to make an authorization page in the Vue project itself or is this unacceptable? An independent vanilla login page comes to mind, which will load the admin from the server when you log in.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
coderisimo, 2021-12-04
@coderisimo

Of course you can.
You send a login-password to the server, in response you receive, for example, a JWT token, with which you then sign all requests. When the token "goes bad" - get a new one And so on. All this can be implemented on the same axios. There are examples on the net.
There are other possibilities as well. For example, if backing to Yii , a session is created on the server during authentication, you get cookies and a CSRF token, which you also add to the request headers.
Authorization on the client is not easy to bypass, because in fact it is not on the client, but on the server))) If you have not been authorized to perform any server operations, your requests will simply be sent by the forest.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question