feat(webui): Display logged-in username
- Add username display in the `SiteHeader` component. - Update logout button text to include username. - Add `username` field in auth state. - Optimize token parsing logic to extract username information. - pre-commit fix
This commit is contained in:
@@ -21,12 +21,12 @@ class AuthHandler:
|
||||
self.algorithm = "HS256"
|
||||
self.expire_hours = int(os.getenv("TOKEN_EXPIRE_HOURS", 4))
|
||||
self.guest_expire_hours = int(os.getenv("GUEST_TOKEN_EXPIRE_HOURS", 2))
|
||||
|
||||
|
||||
self.accounts = {}
|
||||
auth_accounts = os.getenv("AUTH_ACCOUNTS")
|
||||
if auth_accounts:
|
||||
for account in auth_accounts.split(','):
|
||||
username, password = account.split(':', 1)
|
||||
for account in auth_accounts.split(","):
|
||||
username, password = account.split(":", 1)
|
||||
self.accounts[username] = password
|
||||
|
||||
def create_token(
|
||||
|
1
lightrag/api/webui/assets/index-BcBS1RaQ.css
generated
Normal file
1
lightrag/api/webui/assets/index-BcBS1RaQ.css
generated
Normal file
File diff suppressed because one or more lines are too long
1
lightrag/api/webui/assets/index-Cq65VeVX.css
generated
1
lightrag/api/webui/assets/index-Cq65VeVX.css
generated
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
34
lightrag/api/webui/index.html
generated
34
lightrag/api/webui/index.html
generated
@@ -1,17 +1,17 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<link rel="icon" type="image/svg+xml" href="logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lightrag</title>
|
||||
<script type="module" crossorigin src="/webui/assets/index-DlScqWrq.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/webui/assets/index-Cq65VeVX.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<link rel="icon" type="image/svg+xml" href="logo.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Lightrag</title>
|
||||
<script type="module" crossorigin src="/webui/assets/index-qXLILB5u.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/webui/assets/index-BcBS1RaQ.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user