diff --git a/package.json b/package.json index 53ad524571..341ca9528f 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "prom-client": "^13.1.0", "response-time": "^2.3.2", "serve-favicon": "^2.5.0", - "unleash-frontend": "4.0.0-alpha.6", + "unleash-frontend": "4.0.0-alpha.7", "uuid": "^8.3.2", "yargs": "^16.0.3" }, diff --git a/src/lib/app.ts b/src/lib/app.ts index 0b3ddc7387..4d85378ca4 100644 --- a/src/lib/app.ts +++ b/src/lib/app.ts @@ -18,7 +18,7 @@ import unleashDbSession from './middleware/session-db'; import IndexRouter from './routes'; import requestLogger from './middleware/request-logger'; -import simpleAuthentication from './middleware/simple-authentication'; +import demoAuthentication from './middleware/demo-authentication'; import ossAuthentication from './middleware/oss-authentication'; import noAuthentication from './middleware/no-authentication'; import secureHeaders from './middleware/secure-headers'; @@ -74,7 +74,7 @@ export default function getApp( break; } case IAuthType.DEMO: { - simpleAuthentication(app, config.server.baseUriPath, services); + demoAuthentication(app, config.server.baseUriPath, services); break; } case IAuthType.CUSTOM: { @@ -87,7 +87,7 @@ export default function getApp( break; } default: { - simpleAuthentication(app, config.server.baseUriPath, services); + demoAuthentication(app, config.server.baseUriPath, services); break; } } diff --git a/src/lib/middleware/simple-authentication.js b/src/lib/middleware/demo-authentication.js similarity index 89% rename from src/lib/middleware/simple-authentication.js rename to src/lib/middleware/demo-authentication.js index eb4999eb4f..2683ac18ef 100644 --- a/src/lib/middleware/simple-authentication.js +++ b/src/lib/middleware/demo-authentication.js @@ -2,7 +2,7 @@ const auth = require('basic-auth'); const User = require('../user'); const AuthenticationRequired = require('../authentication-required'); -function insecureAuthentication(app, basePath = '', { userService }) { +function demoAuthentication(app, basePath = '', { userService }) { app.post(`${basePath}/api/admin/login`, async (req, res) => { const { email } = req.body; const user = await userService.loginUserWithoutPassword(email, true); @@ -33,7 +33,7 @@ function insecureAuthentication(app, basePath = '', { userService }) { .json( new AuthenticationRequired({ path: `${basePath}/api/admin/login`, - type: 'unsecure', + type: 'demo', message: 'You have to identify yourself in order to use Unleash.', }), @@ -42,4 +42,4 @@ function insecureAuthentication(app, basePath = '', { userService }) { }); } -module.exports = insecureAuthentication; +module.exports = demoAuthentication; diff --git a/yarn.lock b/yarn.lock index eff144b53e..aeac8b65ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6882,10 +6882,10 @@ universalify@^0.1.0: resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -unleash-frontend@4.0.0-alpha.6: - version "4.0.0-alpha.6" - resolved "https://registry.yarnpkg.com/unleash-frontend/-/unleash-frontend-4.0.0-alpha.6.tgz#313cd3544bf74da221a85251b82c9ac7ef2ed59d" - integrity sha512-ZhfFyHCBdLI99PCxtNKVSsHWooamNRvHlzofkKtcf2su4nSQcryTfjskI9H04BcbBCGBZcEE3stqRIpyymKNYg== +unleash-frontend@4.0.0-alpha.7: + version "4.0.0-alpha.7" + resolved "https://registry.yarnpkg.com/unleash-frontend/-/unleash-frontend-4.0.0-alpha.7.tgz#bee86ea40471b3ffbdf7880506b219a7e25e68b4" + integrity sha512-WW3LU8/2T0zUPVn0JMvlwLpFYP3YvB+JbagMUXhM+BaSN7xIUWUGcfEdmbyk7e3pDs0g7wIPZjjtZ++C5DT4KA== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0"