Skip to content

Commit

Permalink
Fix dupe feature
Browse files Browse the repository at this point in the history
  • Loading branch information
AlinaNova21 committed Nov 24, 2020
1 parent 2db9f63 commit 7db13ac
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
4 changes: 1 addition & 3 deletions lib/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ module.exports = function (cconfig, authIns) {
allowRegistration: !process.env.SERVER_PASSWORD,
steam: true
}
config.backend.features = config.backend.features || []
config.backend.features.push(...require('./menu.js'))
config.backend.features.push(config.auth.info)
config.auth.router = new express.Router()
config.backend.on('expressPreConfig', function (app) {
process.on('SIGTERM', () => process.exit())
Expand Down Expand Up @@ -109,6 +106,7 @@ function setupRouter (config) {
require('./register')(config)
require('./steam')(config)
require('./github')(config)
require('./menu.js')(config)
}

function bodyParse (req, res, next) {
Expand Down
44 changes: 26 additions & 18 deletions lib/menu.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
module.exports = [
{
name: 'auth',
version: 1
},
{
name: 'screepsmod-auth',
version: 1,
menuData: [
{
section: 2,
start: 1,
item: {
label: 'Change Password',
href: '#!/account/password',
module.exports = config => {
config.backend.features = config.backend.features || []
const authTypes = ['password']
if (config.auth.info.steam) authTypes.push('steam')
if (config.auth.info.github) authTypes.push('github')

config.backend.features.push(...[
{
name: 'auth',
version: 1
},
{
name: 'screepsmod-auth',
version: require('../package.json').version,
authTypes,
menuData: [
{
section: 2,
start: 1,
item: {
label: 'Change Password',
href: '#!/account/password',
}
}
}
]
}
]
}
])
]

0 comments on commit 7db13ac

Please sign in to comment.