Skip to content

Commit 2a5d5d2

Browse files
authored
update simple password implement
1 parent ffe2cfc commit 2a5d5d2

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

server/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const app = express();
77

88
const defaultRegionId = 'cn-shanghai';
99

10+
// simple implement password check
11+
const adminPass = 'test';
12+
const userPassMap = {
13+
'test1': 'test1'
14+
};
15+
1016
// simply record session
1117
const sessions = [];
1218

@@ -219,7 +225,7 @@ app.post("/user/login", async (req, res) => {
219225

220226
const apps = await queryAllApps(regionId);
221227

222-
const app = apps.find((app) => app?.appName === username && pass === 'test');
228+
const app = apps.find((app) => app?.appName === username && ((userPassMap[username] === pass) || pass === adminPass));
223229

224230
if (app) {
225231
// init session

0 commit comments

Comments
 (0)