I am using python. On my page, when an anonymous user goes to the login page, I want to pass the variable to the backend so that it indicates where the user is coming from (send the URL).
So, when the user clicks on this binding:
<a href="{{ url_for('account.signin') }}">Sign in</a>
I want to send the current URL of the page where the user is located.
<script>
var current_url = window.location.href;
<script>
I decided to send it like this:
<a href="{{ url_for('account.signin', current_url="window.location.href") }}">Sign in</a>
But I can not use javascript code inside url_for or how to pass it?
Babel source
share