-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlx-ui] Add an ENV var to disable login (#87)
Use an Env var to control if login mechanism is needed or not. When the login is off, all requests are treated as admin. Signed-off-by: Yihong Wang <[email protected]>
- Loading branch information
Showing
6 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,13 @@ type UserInfo = { | |
}; | ||
|
||
const DEFAULT_USER_CONFIG = '/workspace/models/admin.json'; | ||
export const DEFAULT_ADMIN_EMAIL = '[email protected]'; | ||
|
||
export function loadUsers(): Users { | ||
if (existsSync(DEFAULT_USER_CONFIG)) { | ||
return require(DEFAULT_USER_CONFIG); | ||
} | ||
// return default settings if config file doesn't exist | ||
return {"admin": {"password": "passw0rd", "email": "[email protected]", "roles": ["admin"]}}; | ||
return {"admin": {"password": "passw0rd", "email": DEFAULT_ADMIN_EMAIL, "roles": ["admin"]}}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters