فهرست منبع

Fix googleAuth

Sotaro KARASAWA 10 سال پیش
والد
کامیت
385cf268c3
3فایلهای تغییر یافته به همراه6 افزوده شده و 7 حذف شده
  1. 3 3
      lib/routes/login.js
  2. 2 2
      lib/routes/me.js
  3. 1 2
      lib/util/googleAuth.js

+ 3 - 3
lib/routes/login.js

@@ -82,7 +82,7 @@ module.exports = function(crowi, app) {
   };
 
   actions.loginGoogle = function(req, res) {
-    var googleAuth = require('../util/googleAuth')(app);
+    var googleAuth = require('../util/googleAuth')(config);
     var code = req.session.googleAuthCode || null;
 
     if (!code) {
@@ -134,7 +134,7 @@ module.exports = function(crowi, app) {
   };
 
   actions.register = function(req, res) {
-    var googleAuth = require('../util/googleAuth')(app);
+    var googleAuth = require('../util/googleAuth')(config);
 
     // ログイン済みならさようなら
     if (req.user) {
@@ -269,7 +269,7 @@ module.exports = function(crowi, app) {
   };
 
   actions.registerGoogle = function(req, res) {
-    var googleAuth = require('../util/googleAuth')(app);
+    var googleAuth = require('../util/googleAuth')(config);
     googleAuth.createAuthUrl(req, function(err, redirectUrl) {
       if (err) {
         // TODO

+ 2 - 2
lib/routes/me.js

@@ -179,7 +179,7 @@ module.exports = function(crowi, app) {
   };
 
   actions.authGoogle = function(req, res) {
-    var googleAuth = require('../util/googleAuth')(app);
+    var googleAuth = require('../util/googleAuth')(config);
 
     var userData = req.user;
 
@@ -206,7 +206,7 @@ module.exports = function(crowi, app) {
   };
 
   actions.authGoogleCallback = function(req, res) {
-    var googleAuth = require('../util/googleAuth')(app);
+    var googleAuth = require('../util/googleAuth')(config);
     var userData = req.user;
 
     googleAuth.handleCallback(req, function(err, tokenInfo) {

+ 1 - 2
lib/util/googleAuth.js

@@ -2,12 +2,11 @@
  * googleAuth utility
  */
 
-module.exports = function(app) {
+module.exports = function(config) {
   'use strict';
 
   var googleapis = require('googleapis')
     , debug = require('debug')('crowi:lib:googleAuth')
-    , config = app.set('config')
     , lib = {}
     ;