2
0
Эх сурвалжийг харах

get rid of __ and changed variable name

sou 7 жил өмнө
parent
commit
3799be7a82

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

@@ -79,7 +79,7 @@ module.exports = function(crowi, app) {
     }
     }
 
 
     const provider = 'ldap';
     const provider = 'ldap';
-    const ldapAccountInfo = await __promisifiedPassportAuthentication(req, res, next, provider);
+    const ldapAccountInfo = await promisifiedPassportAuthentication(req, res, next, provider);
 
 
     /*
     /*
       * authentication success
       * authentication success
@@ -208,7 +208,7 @@ module.exports = function(crowi, app) {
 
 
   const loginPassportGoogleCallback = async(req, res, next) => {
   const loginPassportGoogleCallback = async(req, res, next) => {
     const provider = 'google';
     const provider = 'google';
-    const response = await __promisifiedPassportAuthentication(req, res, next, provider);
+    const response = await promisifiedPassportAuthentication(req, res, next, provider);
     const userInfo = {
     const userInfo = {
       'id': response.id,
       'id': response.id,
       'username': response.displayName,
       'username': response.displayName,
@@ -224,7 +224,7 @@ module.exports = function(crowi, app) {
     });
     });
   };
   };
 
 
-  const __promisifiedPassportAuthentication = (req, res, next, provider) => {
+  const promisifiedPassportAuthentication = (req, res, next, provider) => {
     if(provider === 'ldap'){ provider = 'ldapauth' };
     if(provider === 'ldap'){ provider = 'ldapauth' };
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
       passport.authenticate(provider, (err, response, info) => {
       passport.authenticate(provider, (err, response, info) => {

+ 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
         # 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
         # https://github.com/weseek/growi/issues/193
         #}
         #}
-        {% set failedProvider = req.flash('provider-DuplicatedUsernameException') %}
-        {% if failedProvider != null %}
+        {% set failedProvider-DuplicatedUsernameException = req.flash('provider-DuplicatedUsernameException') %}
+        {% if failedProvider-DuplicatedUsernameException != null %}
         <div class="alert alert-warning small">
         <div class="alert alert-warning small">
           <p><strong><i class="icon-fw icon-ban"></i>DuplicatedUsernameException occured</strong></p>
           <p><strong><i class="icon-fw icon-ban"></i>DuplicatedUsernameException occured</strong></p>
           <p>
           <p>
-            Your {{ failedProvider }} authentication was succeess, but a new user could not be created.
+            Your {{ failedProvider-DuplicatedUsernameException }} 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>.
             See the issue <a href="https://github.com/weseek/growi/issues/193">#193</a>.
           </p>
           </p>
         </div>
         </div>