V
V
Vladyslav2021-02-13 15:37:13
Java
Vladyslav, 2021-02-13 15:37:13

How to redirect to your page after logging?

How to make sure that after authorization, a person gets to his page, so that this id would be in the url?
localhost:8080/user/?id=1

I can't think of this moment

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Fedorov, 2021-02-13
@Avgona

You do not need an id in the
Tk url after authentication /user and everyone will have their own. The user id will be in the session (if this is a normal browser script, not api)
Write authentication according to the documentation, close the /user route for unauthenticated ones
Here is an example:

  • https://spring.io/guides/gs/securing-web/

T
ThunderCat, 2021-02-13
@ThunderCat

1) why do you have muscle in tags?
2) Read about headers, in particular response codes 301/302 and location
3) "Logging" is writing to the log, what you meant is called authorization or "login".
4) After login, you should create a user object, in which, in particular, you can find the id property.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question