   afterLoginCallback: (err, params={})->
     @loginForm.button.hideLoader()
     {entryPoint} = KD.config
-
     if err
-      if err.message.length > 50
-        new KDModalView
-          title        : "Something is wrong!"
-          width        : 500
-          overlay      : yes
-          cssClass     : "new-kdmodal"
-          content      :
-            """
-              <div class='modalformline'>
-                #{err.message}
-              </div>
-            """
-      else
-        new KDNotificationView
-          title   : err.message
-          duration: 1000
-
+      showError err
       @loginForm.resetDecoration()
     else
       {account, replacementToken} = params


      KD.remote.api.JUser.authenticateWithOauth params, (err, resp)=>
        if err
          new KDNotificationView
            title : "An error occurred: #{err.message}"
        else
          {account, replacementToken, isNewUser, userInfo} = resp
          if isNewUser

      return "/#{entryPoint.slug}/#{route}"
    else
      return "/#{route}"

  showError = (err)->
    if err.message.length > 50
      new KDModalView
        title        : "Something is wrong!"
        width        : 500
        overlay      : yes
        cssClass     : "new-kdmodal"
        content      :
          """
            <div class='modalformline'>
              #{err.message}
            </div>
          """
    else
      new KDNotificationView
        title   : err.message
        duration: 1000
