S
S
symnoob2020-05-13 15:33:03
symfony
symnoob, 2020-05-13 15:33:03

How to redirect after authorization to a previously requested resource?

You need one Chip,

this is quite common, so the question is how best to implement it or how do you do it?

A simple example:

A user accesses a protected resource, while he is not authorized. At the moment, after authorization, he gets to his account.

And it is necessary that he gets to the protected resource that he requested before.

Are there any ideas how to do it better?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2020-05-13
@symnoob

By default, it works the way you want:

By default, the form will redirect to the URL the user requested (ie the URL which triggered the login form being shown). For example, if the user requested http://www.example.com/admin/post/18/edit, then after they have successfully logged in, they will be sent back to http://www.example.com/admin/post/18/edit.
Redirecting after Success¶

Apparently your behavior has been changed via always_use_default_target_path:
Changing the default Page¶
...or in some other way...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question