fix SMTP configuration
This commit is contained in:
@@ -21,7 +21,7 @@ const Auth = {
|
||||
})
|
||||
},
|
||||
|
||||
isAuth (req, res, next) {
|
||||
isAuth (_req, res, next) {
|
||||
if (res.locals.user) {
|
||||
next()
|
||||
} else {
|
||||
|
||||
@@ -171,6 +171,10 @@ const settingsController = {
|
||||
}
|
||||
},
|
||||
|
||||
getSMTPSettings (_req, res) {
|
||||
return res.json(settingsController['settings']['smtp'])
|
||||
},
|
||||
|
||||
setLogo (req, res) {
|
||||
if (!req.file) {
|
||||
settingsController.set('logo', false)
|
||||
|
||||
@@ -140,6 +140,7 @@ if (config.status !== 'READY') {
|
||||
api.post('/settings', isAdmin, settingsController.setRequest)
|
||||
api.post('/settings/logo', isAdmin, multer({ dest: config.upload_path }).single('logo'), settingsController.setLogo)
|
||||
api.post('/settings/smtp', isAdmin, settingsController.testSMTP)
|
||||
api.get('/settings/smtp', isAdmin, settingsController.getSMTPSettings)
|
||||
|
||||
// get unconfirmed events
|
||||
api.get('/event/unconfirmed', isAdmin, eventController.getUnconfirmed)
|
||||
|
||||
@@ -12,7 +12,7 @@ const oauthServer = new OAuthServer({
|
||||
debug: true,
|
||||
requireClientAuthentication: { password: false },
|
||||
authenticateHandler: {
|
||||
handle (req, res) {
|
||||
handle (_req, res) {
|
||||
if (!res.locals.user) {
|
||||
throw new Error('Not authenticated!')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user