summaryrefslogtreecommitdiff
path: root/lib/web/auth
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/web/auth/dropbox/index.js6
-rw-r--r--lib/web/auth/email/index.js10
-rw-r--r--lib/web/auth/facebook/index.js6
-rw-r--r--lib/web/auth/github/index.js6
-rw-r--r--lib/web/auth/gitlab/index.js6
-rw-r--r--lib/web/auth/google/index.js6
-rw-r--r--lib/web/auth/index.js2
-rw-r--r--lib/web/auth/ldap/index.js4
-rw-r--r--lib/web/auth/mattermost/index.js6
-rw-r--r--lib/web/auth/saml/index.js12
-rw-r--r--lib/web/auth/twitter/index.js6
11 files changed, 35 insertions, 35 deletions
diff --git a/lib/web/auth/dropbox/index.js b/lib/web/auth/dropbox/index.js
index c03fbc57..c44607da 100644
--- a/lib/web/auth/dropbox/index.js
+++ b/lib/web/auth/dropbox/index.js
@@ -12,7 +12,7 @@ passport.use(new DropboxStrategy({
apiVersion: '2',
clientID: config.dropbox.clientID,
clientSecret: config.dropbox.clientSecret,
- callbackURL: config.serverurl + '/auth/dropbox/callback'
+ callbackURL: config.serverURL + '/auth/dropbox/callback'
}, passportGeneralCallback))
dropboxAuth.get('/auth/dropbox', function (req, res, next) {
@@ -23,7 +23,7 @@ dropboxAuth.get('/auth/dropbox', function (req, res, next) {
// dropbox auth callback
dropboxAuth.get('/auth/dropbox/callback',
passport.authenticate('dropbox-oauth2', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/email/index.js b/lib/web/auth/email/index.js
index 760075f8..f7e58d46 100644
--- a/lib/web/auth/email/index.js
+++ b/lib/web/auth/email/index.js
@@ -31,7 +31,7 @@ passport.use(new LocalStrategy({
})
}))
-if (config.allowemailregister) {
+if (config.allowEmailRegister) {
emailAuth.post('/register', urlencodedParser, function (req, res, next) {
if (!req.body.email || !req.body.password) return response.errorBadRequest(res)
if (!validator.isEmail(req.body.email)) return response.errorBadRequest(res)
@@ -51,10 +51,10 @@ if (config.allowemailregister) {
logger.debug('user found: ' + user.id)
req.flash('error', 'This email has been used, please try another one.')
}
- return res.redirect(config.serverurl + '/')
+ return res.redirect(config.serverURL + '/')
}
req.flash('error', 'Failed to register your account, please try again.')
- return res.redirect(config.serverurl + '/')
+ return res.redirect(config.serverURL + '/')
}).catch(function (err) {
logger.error('auth callback failed: ' + err)
return response.errorInternalError(res)
@@ -67,8 +67,8 @@ emailAuth.post('/login', urlencodedParser, function (req, res, next) {
if (!validator.isEmail(req.body.email)) return response.errorBadRequest(res)
setReturnToFromReferer(req)
passport.authenticate('local', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/',
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/',
failureFlash: 'Invalid email or password.'
})(req, res, next)
})
diff --git a/lib/web/auth/facebook/index.js b/lib/web/auth/facebook/index.js
index 0e5474d8..b2364989 100644
--- a/lib/web/auth/facebook/index.js
+++ b/lib/web/auth/facebook/index.js
@@ -12,7 +12,7 @@ let facebookAuth = module.exports = Router()
passport.use(new FacebookStrategy({
clientID: config.facebook.clientID,
clientSecret: config.facebook.clientSecret,
- callbackURL: config.serverurl + '/auth/facebook/callback'
+ callbackURL: config.serverURL + '/auth/facebook/callback'
}, passportGeneralCallback))
facebookAuth.get('/auth/facebook', function (req, res, next) {
@@ -23,7 +23,7 @@ facebookAuth.get('/auth/facebook', function (req, res, next) {
// facebook auth callback
facebookAuth.get('/auth/facebook/callback',
passport.authenticate('facebook', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/github/index.js b/lib/web/auth/github/index.js
index a72ad527..ece634ba 100644
--- a/lib/web/auth/github/index.js
+++ b/lib/web/auth/github/index.js
@@ -12,7 +12,7 @@ let githubAuth = module.exports = Router()
passport.use(new GithubStrategy({
clientID: config.github.clientID,
clientSecret: config.github.clientSecret,
- callbackURL: config.serverurl + '/auth/github/callback'
+ callbackURL: config.serverURL + '/auth/github/callback'
}, passportGeneralCallback))
githubAuth.get('/auth/github', function (req, res, next) {
@@ -23,8 +23,8 @@ githubAuth.get('/auth/github', function (req, res, next) {
// github auth callback
githubAuth.get('/auth/github/callback',
passport.authenticate('github', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/gitlab/index.js b/lib/web/auth/gitlab/index.js
index 51de1602..38436024 100644
--- a/lib/web/auth/gitlab/index.js
+++ b/lib/web/auth/gitlab/index.js
@@ -14,7 +14,7 @@ passport.use(new GitlabStrategy({
clientID: config.gitlab.clientID,
clientSecret: config.gitlab.clientSecret,
scope: config.gitlab.scope,
- callbackURL: config.serverurl + '/auth/gitlab/callback'
+ callbackURL: config.serverURL + '/auth/gitlab/callback'
}, passportGeneralCallback))
gitlabAuth.get('/auth/gitlab', function (req, res, next) {
@@ -25,8 +25,8 @@ gitlabAuth.get('/auth/gitlab', function (req, res, next) {
// gitlab auth callback
gitlabAuth.get('/auth/gitlab/callback',
passport.authenticate('gitlab', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/google/index.js b/lib/web/auth/google/index.js
index 609c69cf..60282cf5 100644
--- a/lib/web/auth/google/index.js
+++ b/lib/web/auth/google/index.js
@@ -11,7 +11,7 @@ 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'
}, passportGeneralCallback))
googleAuth.get('/auth/google', function (req, res, next) {
@@ -21,7 +21,7 @@ googleAuth.get('/auth/google', function (req, res, next) {
// google auth callback
googleAuth.get('/auth/google/callback',
passport.authenticate('google', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/index.js b/lib/web/auth/index.js
index 9ab62c25..eb42fb36 100644
--- a/lib/web/auth/index.js
+++ b/lib/web/auth/index.js
@@ -51,5 +51,5 @@ authRouter.get('/logout', function (req, res) {
logger.debug('user logout: ' + req.user.id)
}
req.logout()
- res.redirect(config.serverurl + '/')
+ res.redirect(config.serverURL + '/')
})
diff --git a/lib/web/auth/ldap/index.js b/lib/web/auth/ldap/index.js
index 6aa9789f..ab1cb4cd 100644
--- a/lib/web/auth/ldap/index.js
+++ b/lib/web/auth/ldap/index.js
@@ -84,8 +84,8 @@ ldapAuth.post('/auth/ldap', urlencodedParser, function (req, res, next) {
if (!req.body.username || !req.body.password) return response.errorBadRequest(res)
setReturnToFromReferer(req)
passport.authenticate('ldapauth', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/',
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/',
failureFlash: true
})(req, res, next)
})
diff --git a/lib/web/auth/mattermost/index.js b/lib/web/auth/mattermost/index.js
index 9ccf3de5..63a4886f 100644
--- a/lib/web/auth/mattermost/index.js
+++ b/lib/web/auth/mattermost/index.js
@@ -16,7 +16,7 @@ let mattermostStrategy = new OAuthStrategy({
tokenURL: config.mattermost.baseURL + '/oauth/access_token',
clientID: config.mattermost.clientID,
clientSecret: config.mattermost.clientSecret,
- callbackURL: config.serverurl + '/auth/mattermost/callback'
+ callbackURL: config.serverURL + '/auth/mattermost/callback'
}, passportGeneralCallback)
mattermostStrategy.userProfile = (accessToken, done) => {
@@ -43,7 +43,7 @@ mattermostAuth.get('/auth/mattermost', function (req, res, next) {
// mattermost auth callback
mattermostAuth.get('/auth/mattermost/callback',
passport.authenticate('oauth2', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/saml/index.js b/lib/web/auth/saml/index.js
index 386293ae..3ecbc6f3 100644
--- a/lib/web/auth/saml/index.js
+++ b/lib/web/auth/saml/index.js
@@ -13,9 +13,9 @@ const intersection = function (array1, array2) { return array1.filter((n) => arr
let samlAuth = module.exports = Router()
passport.use(new SamlStrategy({
- callbackUrl: config.serverurl + '/auth/saml/callback',
+ callbackUrl: config.serverURL + '/auth/saml/callback',
entryPoint: config.saml.idpSsoUrl,
- issuer: config.saml.issuer || config.serverurl,
+ issuer: config.saml.issuer || config.serverURL,
cert: fs.readFileSync(config.saml.idpCert, 'utf-8'),
identifierFormat: config.saml.identifierFormat
}, function (user, done) {
@@ -77,15 +77,15 @@ passport.use(new SamlStrategy({
samlAuth.get('/auth/saml',
passport.authenticate('saml', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
samlAuth.post('/auth/saml/callback', urlencodedParser,
passport.authenticate('saml', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)
diff --git a/lib/web/auth/twitter/index.js b/lib/web/auth/twitter/index.js
index 5429522d..c1860d93 100644
--- a/lib/web/auth/twitter/index.js
+++ b/lib/web/auth/twitter/index.js
@@ -12,7 +12,7 @@ let twitterAuth = module.exports = Router()
passport.use(new TwitterStrategy({
consumerKey: config.twitter.consumerKey,
consumerSecret: config.twitter.consumerSecret,
- callbackURL: config.serverurl + '/auth/twitter/callback'
+ callbackURL: config.serverURL + '/auth/twitter/callback'
}, passportGeneralCallback))
twitterAuth.get('/auth/twitter', function (req, res, next) {
@@ -23,7 +23,7 @@ twitterAuth.get('/auth/twitter', function (req, res, next) {
// twitter auth callback
twitterAuth.get('/auth/twitter/callback',
passport.authenticate('twitter', {
- successReturnToOrRedirect: config.serverurl + '/',
- failureRedirect: config.serverurl + '/'
+ successReturnToOrRedirect: config.serverURL + '/',
+ failureRedirect: config.serverURL + '/'
})
)