Browse Source

Added a check to hide the login form when connection an existing account

Christophe Coevoet 12 years ago
parent
commit
9e07b10d16
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/Resources/HWIOAuthBundle/views/Connect/login.html.twig

+ 4 - 0
app/Resources/HWIOAuthBundle/views/Connect/login.html.twig

@@ -8,6 +8,9 @@
     <a class="submit" href="{{ hwi_oauth_login_url(owner) }}">Login with {{ owner | trans({}, 'HWIOAuthBundle') }}</a> <br />
     {% endfor %}
 
+    {# HWIOAuthBundle uses the same template for the login and the connect functionality currently
+       so we need to check if the user is already authenticated. #}
+    {% if not app.user %}
     <form action="{{ path('login_check') }}" method="post">
         <div>
             <label for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
@@ -28,4 +31,5 @@
     </form>
 
     <a href="{{ path('fos_user_resetting_request') }}">Forgot password?</a>
+    {% endif %}
 {% endblock hwi_oauth_content %}