A
A
alaskafx2022-01-23 12:08:31
JSON Web Token
alaskafx, 2022-01-23 12:08:31

What is the best way to make/improve user login logic?



The essence of the question is that if the user already has a valid token and it needs to be authorized regardless of where it is located in the application: stores the token and sends a request to the server to authorize the token. But I started to dislike this approach because it looks somehow "average".

2. After thinking for a while, I decided that I would authorize the user through beforeEnter in the router, they say, just protect routes from anonymous | After n time, this approach also began to seem to me like a "crutch" or the like, so I also threw it aside.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2022-01-23
@Aetae

This is usually done in beforeEach.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question