Просмотр исходного кода

DuplicatedUsernameException error message

sou 7 лет назад
Родитель
Сommit
4d84fbefe5
2 измененных файлов с 5 добавлено и 5 удалено
  1. 2 2
      lib/routes/login-passport.js
  2. 3 3
      lib/views/login.html

+ 2 - 2
lib/routes/login-passport.js

@@ -140,7 +140,7 @@ module.exports = function(crowi, app) {
         })
         .catch((err) => {
           if (err.name === 'DuplicatedUsernameException') {
-            req.flash('isDuplicatedUsernameExceptionOccured', true);
+            req.flash('provider-DuplicatedUsernameException', 'LDAP');
             return next();
           }
           else {
@@ -286,7 +286,7 @@ module.exports = function(crowi, app) {
       })
       .catch((err) => {
         if (err.name === 'DuplicatedUsernameException') {
-          req.flash('isDuplicatedUsernameExceptionOccured', true);
+          req.flash('provider-DuplicatedUsernameException', 'Google');
           return next();
         }
         else {

+ 3 - 3
lib/views/login.html

@@ -42,12 +42,12 @@
         # The case that there already exists a user whose username matches ID of the newly created LDAP user
         # https://github.com/weseek/growi/issues/193
         #}
-        {% set isDuplicatedUsernameExceptionOccured = req.flash('isDuplicatedUsernameExceptionOccured') %}
-        {% if isDuplicatedUsernameExceptionOccured != null %}
+        {% set failedProvider = req.flash('provider-DuplicatedUsernameException') %}
+        {% if failedProvider != null %}
         <div class="alert alert-warning small">
           <p><strong><i class="icon-fw icon-ban"></i>DuplicatedUsernameException occured</strong></p>
           <p>
-            Your LDAP authentication was succeess, but a new user could not be created.
+            Your {{ failedProvider }} authentication was succeess, but a new user could not be created.
             See the issue <a href="https://github.com/weseek/growi/issues/193">#193</a>.
           </p>
         </div>