diff --git a/modules/core/templates/loginuserpass.twig b/modules/core/templates/loginuserpass.twig
index 76370317bd56dbcfcb36bf488a61603229289a13..f5d03726f6c4826acae768da4fca3160e89a5c8e 100644
--- a/modules/core/templates/loginuserpass.twig
+++ b/modules/core/templates/loginuserpass.twig
@@ -38,7 +38,7 @@
     <p>{{ 'A service has requested you to authenticate yourself. Please enter your username and password in the form below.'|trans }}</p>
     <br>
     <div class="center">
-        <form class="pure-form pure-form-aligned center-form" action="{{ '?AuthState=' ~ AuthState }}" method="post" name="f">
+        <form class="pure-form pure-form-aligned center-form" action="{{ moduleURL('core/loginuserpass', {'AuthState': AuthState}) }}" method="post" name="f">
             <div class="form-align">
 
                 <div class="pure-control-group">