diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java index 0322ed10b6..2a1e742a5d 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/FreeMarkerLoginFormsProvider.java @@ -317,7 +317,7 @@ public class FreeMarkerLoginFormsProvider implements LoginFormsProvider { */ private UriBuilder getTotpUriBuilder() { return uriInfo.getBaseUriBuilder() - .replacePath(uriInfo.getRequestUri().getPath()) + .path(uriInfo.getPath()) .replaceQuery(uriInfo.getRequestUri().getQuery()); }