How do you get the current destination URL query parameter in Twig?
You can use path() function with '&lt;current&gt;' pseudo URI to generate current page relative URL.
For example:
{# in hard-coded path (bad practice) #}
&lt;a href=&quot;/user/login?destination={{ path('&lt;current&gt;') }}&quot; class=&quot;btn btn-sm btn-primary icon-before&quot;&gt;&lt;i class=&quot;fad fa-sign-in&quot;&gt;&lt;/i&gt; Sign-In&lt;/a&gt;

{# more proper twig-like way #}
&lt;p&gt;
You can try &lt;a href=&quot;{{ path('user.login', {}, {'query': {'destination': path('&lt;current&gt;') }}) }}&quot;&gt;logging in&lt;/a&gt; to see if you have access.
&lt;/p&gt;

More about Drupal's twig built-in functions here: https://www.drupal.org/docs/theming-drupal/twig-in-drupal/functions-in-twig-templates