Answer the question
In order to leave comments, you need to log in
DOMDocument and insertbefore?
Hello,
there is markup -
<p> ... </p>
<p><img src=""></p>
<p> ... </p>
<img src="">
$image->parentNode->insertBefore($image);
- it turns out garbage. Answer the question
In order to leave comments, you need to log in
The correctness should be checked by the server when you want something from it with this token. On the client, everything is simple - there is a token, we consider that the user is logged in, draw buttons for him and go to the server with this token - if something is wrong, the server will tell us, for example, it will return 401, in this case we delete the token on the client and send the user to /login.
I have done this:
In the store I store the key verification function, which checks if there is a key (jwt), then check it for obsolescence, if the time has come, send a request to renew the key, if not, return true, if there is no key, return false .
Further, I slip this check under each route in the global router.beforeEach, if the check returns true, next() follows from the route, if false, redirect to the page with the login form
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question