feat(auth): Implement multi-user login support
- Add an `accounts` dictionary in `AuthHandler` to store multiple user account information. - Modify login logic to support multiple user account verification. - Update environment variable example, add description for `AUTH_ACCOUNTS` variable. - Adjust authentication status check logic, use `auth_handler.accounts` to determine if authentication is configured.
This commit is contained in:
11
env.example
11
env.example
@@ -151,9 +151,8 @@ QDRANT_URL=http://localhost:16333
|
||||
### Redis
|
||||
REDIS_URI=redis://localhost:6379
|
||||
|
||||
### For JWTt Auth
|
||||
AUTH_USERNAME=admin # login name
|
||||
AUTH_PASSWORD=admin123 # password
|
||||
TOKEN_SECRET=your-key-for-LightRAG-API-Server # JWT key
|
||||
TOKEN_EXPIRE_HOURS=4 # expire duration
|
||||
WHITELIST_PATHS=/login,/health # white list
|
||||
### For JWT Auth
|
||||
# AUTH_ACCOUNTS='admin:admin123,user1:pass456' # username:password,username:password
|
||||
# TOKEN_SECRET=Your-Key-For-LightRAG-API-Server # JWT key
|
||||
# TOKEN_EXPIRE_HOURS=4 # expire duration
|
||||
# WHITELIST_PATHS= # white list
|
Reference in New Issue
Block a user