Ajaxly login/signup in bootstrap modal This is sample modal sample of boostrap modal

&lt;div id="signin" class="modal fade" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;

        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                &lt;h4 class="modal-title"&gt;Modal Header&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                &lt;p&gt;Some text in the modal.&lt;/p&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;


and this is a line trigger modal in header.html.twig,

 &lt;li&gt;&lt;a type="button" class="btn btn-lg navbar-btn" data-toggle="modal" data-target="#signup"&gt; {{ 'SIGNUP'|t }}&lt;/a&gt;&lt;/li&gt;


goal: open login form in bootsrap modal.

I find the name of file I can customize user-login block , it's block--userlogin.html.twig
then my markup 

&lt;!-- Modal --&gt;
&lt;div id="signin" class="modal fade" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;
        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                &lt;h4 class="modal-title"&gt;Login&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                &lt;form method="post" action="{{ path( "user.login" ) }}"   role="form" name="loginform"&gt;
                    {% if error %}
                        &lt;div class="warning"&gt;
                            &lt;h3&gt;{{ "Could not login" }}&lt;/h3&gt;
                            &lt;ul&gt;
                                &lt;li&gt;{{ "A valid username and password is required to login." }}&lt;/li&gt;
                            &lt;/ul&gt;
                        &lt;/div&gt;
                    {% endif %}
                    &lt;div class="form-group"&gt;
                        &lt;input type="email" value="{{username }}"   name="_username" tabindex="1" class="form-control" id="email" placeholder="{{ "username or email :"|t}}"&gt;
                    &lt;/div&gt;
                    &lt;div class="form-group"&gt;
                        &lt;input type="password" class="form-control" id="pwd" ame="_password" placeholder="{{ "Password"|t }}"&gt;
                    &lt;/div&gt;
                    &lt;div class="checkbox"&gt;
                        &lt;label&gt;&lt;input type="checkbox"&gt; Remember me&lt;/label&gt;
                    &lt;/div&gt;
                    &lt;button type="submit" class="btn btn-default"&gt;{{ "Sign In"|t }}&lt;/button&gt;
                    &lt;input type="hidden" name="_csrf_token" value="{{ csrf_token }}" /&gt;
                &lt;/form&gt;
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;


but with this action action="{{ path( "user.login" ) }}" it redirect me to user/login page. 
I want to know how can I login/signup usuer ajaxly in modal without redirect to user/login page?
There are two questions:

1.) goal: open login form in bootsrap modal.

In your code by redirecting to a new path the page will reload, and not display a modal login.

But you don't need a new path, your form is already there. It is in the block content and you should be able to place {{ content }} in the bootstrap modal dialog like this.

block--userlogin.html.twig:

&lt;div id="signin" class="modal fade" role="dialog"&gt;
    &lt;div class="modal-dialog"&gt;

        &lt;!-- Modal content--&gt;
        &lt;div class="modal-content"&gt;
            &lt;div class="modal-header"&gt;
                &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                &lt;h4 class="modal-title"&gt;Modal Header&lt;/h4&gt;
            &lt;/div&gt;
            &lt;div class="modal-body"&gt;
                {{ content }}
            &lt;/div&gt;
            &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
            &lt;/div&gt;
        &lt;/div&gt;

    &lt;/div&gt;
&lt;/div&gt;


2.) ajaxifing the login (not reloading after submit)

For this there is some work to do, you can see this in the D7 module:

https://www.drupal.org/project/ajax_register

For D8 you need to code something similar.