Initial commit
This commit is contained in:
27
hedgedocClientSecretAsFile.patch
Normal file
27
hedgedocClientSecretAsFile.patch
Normal file
@@ -0,0 +1,27 @@
|
||||
diff --git a/lib/web/auth/oauth2/index.js b/lib/web/auth/oauth2/index.js
|
||||
index b0ffa5e8a..45229358e 100644
|
||||
--- a/lib/web/auth/oauth2/index.js
|
||||
+++ b/lib/web/auth/oauth2/index.js
|
||||
@@ -6,6 +6,7 @@ const { Strategy, InternalOAuthError } = require('passport-oauth2')
|
||||
const config = require('../../../config')
|
||||
const logger = require('../../../logger')
|
||||
const { passportGeneralCallback } = require('../utils')
|
||||
+const fs = require('fs')
|
||||
|
||||
const oauth2Auth = module.exports = Router()
|
||||
|
||||
@@ -130,11 +131,13 @@ OAuth2CustomStrategy.prototype.userProfile = function (accessToken, done) {
|
||||
})
|
||||
}
|
||||
|
||||
+const OAuth2clientSecretText = fs.readFileSync(config.oauth2.clientSecret, 'utf8').split("\n")[0]
|
||||
+
|
||||
passport.use(new OAuth2CustomStrategy({
|
||||
authorizationURL: config.oauth2.authorizationURL,
|
||||
tokenURL: config.oauth2.tokenURL,
|
||||
clientID: config.oauth2.clientID,
|
||||
- clientSecret: config.oauth2.clientSecret,
|
||||
+ clientSecret: OAuth2clientSecretText,
|
||||
callbackURL: config.serverURL + '/auth/oauth2/callback',
|
||||
userProfileURL: config.oauth2.userProfileURL,
|
||||
scope: config.oauth2.scope,
|
Reference in New Issue
Block a user