Skip to content

Commit

Permalink
show users on login screen only if enabled in config
Browse files Browse the repository at this point in the history
  • Loading branch information
Garfonso committed Dec 18, 2023
1 parent 74079aa commit 3e0904b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions lib/modules/person.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ class PersonModule {

async processRequest(req, res) {
if (req.url === '/api/person/list') {
//TODO: how to find out, if user is logged in?
if (this.adapter.config.showUsersOnLoginScreen) {
res.json(this.usersCache);
} else {
res.json({});
}
res.json(this.usersCache);
} else {
this.adapter.log.warn(`Unknown request ${req.url} for person api.`);
res.json({});
Expand Down
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1655,7 +1655,7 @@ class WebServer {
});

this._app.use('/auth/providers', (req, res) => {
res.json([{id: null, name: 'ioBroker Local', type: 'iobroker', users: this._modules.person.getShorList()}]);
res.json([{id: null, name: 'ioBroker Local', type: 'iobroker', users: this.config.showUsersOnLoginScreen ? this._modules.person.getShorList() : undefined}]);
});

this._app.post('/auth/login_flow', (req, res) => {
Expand Down

0 comments on commit 3e0904b

Please sign in to comment.