590d18
From 4c1b511fbcdca211c913a4db409c66469cdc3a4f Mon Sep 17 00:00:00 2001
590d18
From: Petr Vobornik <pvoborni@redhat.com>
590d18
Date: Tue, 28 Jul 2015 14:01:34 +0200
590d18
Subject: [PATCH] webui: fix regressions failed auth messages
590d18
590d18
1. after logout, krb auth no longer shows "session expired" but correct
590d18
"Authentication with Kerberos failed".
590d18
590d18
2. "The password or username you entered is incorrect." is showed on
590d18
failed forms-based auth.
590d18
590d18
https://fedorahosted.org/freeipa/ticket/5163
590d18
590d18
Reviewed-By: Martin Basti <mbasti@redhat.com>
590d18
---
590d18
 install/ui/src/freeipa/ipa.js                 | 8 ++++----
590d18
 install/ui/src/freeipa/widgets/LoginScreen.js | 2 +-
590d18
 2 files changed, 5 insertions(+), 5 deletions(-)
590d18
590d18
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
590d18
index 75dd73c379815a0e0e1dc2c4d786fdcf3be7c1b0..eaaaaf7fcfaee873d97d96630b72365ecffe6b08 100644
590d18
--- a/install/ui/src/freeipa/ipa.js
590d18
+++ b/install/ui/src/freeipa/ipa.js
590d18
@@ -32,6 +32,7 @@ define([
590d18
         './json2',
590d18
         './_base/i18n',
590d18
         './auth',
590d18
+        './config',
590d18
         './datetime',
590d18
         './metadata',
590d18
         './builder',
590d18
@@ -41,7 +42,8 @@ define([
590d18
         './util',
590d18
         'exports'
590d18
     ], function(declare, Deferred, Evented, keys, topic, $, JSON, i18n, auth,
590d18
-        datetime, metadata_provider, builder, reg, rpc, text, util, exports) {
590d18
+        config, datetime, metadata_provider, builder, reg, rpc, text,
590d18
+        util, exports) {
590d18
 
590d18
 /**
590d18
  * @class
590d18
@@ -127,11 +129,9 @@ var IPA = function () {
590d18
         // if current path matches live server path, use live data
590d18
         if (that.url && window.location.pathname.substring(0, that.url.length) === that.url) {
590d18
             that.json_url = params.url || '/ipa/session/json';
590d18
-            that.login_url = params.url || '/ipa/session/login_kerberos';
590d18
 
590d18
         } else { // otherwise use fixtures
590d18
             that.json_path = params.url || "test/data";
590d18
-            // that.login_url is not needed for fixtures
590d18
         }
590d18
 
590d18
         $.ajaxSetup(that.ajax_options);
590d18
@@ -377,7 +377,7 @@ IPA.get_credentials = function() {
590d18
     }
590d18
 
590d18
     var request = {
590d18
-        url: IPA.login_url,
590d18
+        url: config.krb_login_url,
590d18
         cache: false,
590d18
         type: "GET",
590d18
         success: success_handler,
590d18
diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js
590d18
index fb7ccccc6c34d9c1c7115dd95809f3a39de488eb..eb95b9161f05eeac1ec9aed286c9730dada85d59 100644
590d18
--- a/install/ui/src/freeipa/widgets/LoginScreen.js
590d18
+++ b/install/ui/src/freeipa/widgets/LoginScreen.js
590d18
@@ -232,8 +232,8 @@ define(['dojo/_base/declare',
590d18
                     this.set('view', 'reset');
590d18
                     val_summary.add_info('login', this.password_expired);
590d18
                 } else {
590d18
-                    val_summary.add_error('login', this.form_auth_failed);
590d18
                     password_f.set_value('');
590d18
+                    val_summary.add_error('login', this.form_auth_failed);
590d18
                 }
590d18
             }));
590d18
         },
590d18
-- 
590d18
2.4.3
590d18