           messages    :
             required  : 'Please enter a password.'
 
+    email = teamData.invitation?.email
+
     @email = new KDInputView
       name         : 'email'
       placeholder  : 'Email address'
-      defaultValue : if @alreadyMember then email
+      defaultValue : if @alreadyMember then username else email
       validate     :
         rules      :
           email    : yes

    if @alreadyMember
      """
      <div class='login-input-view'><span>Password</span>{{> @password}}</div>
      <p class='dim'>Since you're already a Koding user to join <i>#{KD.config.groupName}</i> you need to enter your koding.com password to proceed.</p>
      <div class='login-input-view tr'>{{> @checkbox}}{{> @label}}</div>
      {{> @button}}
      """

      style      : 'TeamsModal-button TeamsModal-button--green'
      type       : 'submit'

    teamData = KD.utils.getTeamData()

    if @alreadyMember
      { username } = teamData.signup
      @username.setValue username
      @password.destroy()
      @password = new KDInputView
        type          : 'password'
