diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/config/environment.js | 2 | ||||
-rw-r--r-- | lib/config/hackmdEnvironment.js | 2 | ||||
-rw-r--r-- | lib/config/index.js | 2 | ||||
-rw-r--r-- | lib/response.js | 2 | ||||
-rw-r--r-- | lib/web/auth/google/index.js | 3 |
5 files changed, 6 insertions, 5 deletions
diff --git a/lib/config/environment.js b/lib/config/environment.js index a57fe0db..fc757cf1 100644 --- a/lib/config/environment.js +++ b/lib/config/environment.js @@ -14,7 +14,7 @@ module.exports = { useSSL: toBooleanConfig(process.env.CMD_USESSL), hsts: { enable: toBooleanConfig(process.env.CMD_HSTS_ENABLE), - maxAgeSeconds: process.env.CMD_HSTS_MAX_AGE, + maxAgeSeconds: toIntegerConfig(process.env.CMD_HSTS_MAX_AGE), includeSubdomains: toBooleanConfig(process.env.CMD_HSTS_INCLUDE_SUBDOMAINS), preload: toBooleanConfig(process.env.CMD_HSTS_PRELOAD) }, diff --git a/lib/config/hackmdEnvironment.js b/lib/config/hackmdEnvironment.js index e1c11569..bc20e58a 100644 --- a/lib/config/hackmdEnvironment.js +++ b/lib/config/hackmdEnvironment.js @@ -10,7 +10,7 @@ module.exports = { useSSL: toBooleanConfig(process.env.HMD_USESSL), hsts: { enable: toBooleanConfig(process.env.HMD_HSTS_ENABLE), - maxAgeSeconds: process.env.HMD_HSTS_MAX_AGE, + maxAgeSeconds: toIntegerConfig(process.env.HMD_HSTS_MAX_AGE), includeSubdomains: toBooleanConfig(process.env.HMD_HSTS_INCLUDE_SUBDOMAINS), preload: toBooleanConfig(process.env.HMD_HSTS_PRELOAD) }, diff --git a/lib/config/index.js b/lib/config/index.js index cbe6c39c..e5d02dc1 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -128,7 +128,7 @@ if (config.gitlab && config.gitlab.version !== 'v4' && config.gitlab.version !== config.gitlab.version = 'v4' } // If gitlab scope is api, enable snippets Export/import -config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope === 'api') +config.isGitlabSnippetsEnable = (!config.gitlab.scope || config.gitlab.scope === 'api') && config.isGitLabEnable // Only update i18n files in development setups config.updateI18nFiles = (env === Environment.development) diff --git a/lib/response.js b/lib/response.js index 8191e74f..76793a46 100644 --- a/lib/response.js +++ b/lib/response.js @@ -23,7 +23,7 @@ var response = { responseError(res, '403', 'Forbidden', 'oh no.') } else { req.flash('error', 'You are not allowed to access this page. Maybe try logging in?') - res.redirect(config.serverURL) + res.redirect(config.serverURL + '/') } }, errorNotFound: function (res) { diff --git a/lib/web/auth/google/index.js b/lib/web/auth/google/index.js index 60282cf5..0a4fd55e 100644 --- a/lib/web/auth/google/index.js +++ b/lib/web/auth/google/index.js @@ -11,7 +11,8 @@ let googleAuth = module.exports = Router() passport.use(new GoogleStrategy({ clientID: config.google.clientID, clientSecret: config.google.clientSecret, - callbackURL: config.serverURL + '/auth/google/callback' + callbackURL: config.serverURL + '/auth/google/callback', + userProfileURL: "https://www.googleapis.com/oauth2/v3/userinfo" }, passportGeneralCallback)) googleAuth.get('/auth/google', function (req, res, next) { |