login.html.twig 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {% extends 'HWIOAuthBundle::layout.html.twig' %}
  2. {% block hwi_oauth_content %}
  3. {% if error %}
  4. <div>{{ error }}</div>
  5. {% endif %}
  6. {# HWIOAuthBundle uses the same template for the login and the connect functionality currently
  7. so we need to check if the user is already authenticated. #}
  8. {% if not app.user %}
  9. <div class="loginForm">
  10. <form action="{{ path('login_check') }}" method="post">
  11. <div>
  12. <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
  13. <input type="text" id="username" name="_username" />
  14. </div>
  15. <div>
  16. <label for="password">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
  17. <input type="password" id="password" name="_password" />
  18. </div>
  19. {% if packagist_host and packagist_host in app.request.headers.get('Referer') %}
  20. <input type="hidden" name="_target_path" value="{{ app.request.headers.get('Referer') }}" />
  21. {% endif %}
  22. <input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}" />
  23. </form>
  24. <p>
  25. <a href="{{ path('fos_user_resetting_request') }}">Forgot password?</a>
  26. {% for owner in hwi_oauth_resource_owners() %}
  27. <a class="login-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
  28. {% endfor %}
  29. </p>
  30. </div>
  31. {% else %}
  32. {% for owner in hwi_oauth_resource_owners() %}
  33. <a class="login-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
  34. {% endfor %}
  35. {% endif %}
  36. {% endblock hwi_oauth_content %}