mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
Fix auth handling on user update
This commit is contained in:
@@ -42,8 +42,7 @@ pipx install --suffix _npm git+https://github.com/radoering/poetry.git@non-packa
|
||||
|
||||
More info: https://github.com/python-poetry/poetry/pull/8650
|
||||
|
||||
|
||||
Then creat the virtual environment
|
||||
Then create the virtual environment
|
||||
|
||||
```sh
|
||||
# Fix disable parallel installation stuck: $> poetry_npm config experimental.new-installer false
|
||||
|
||||
@@ -26,7 +26,7 @@ DB_PASSWD: Final = os.environ.get("DB_PASSWD")
|
||||
DB_NAME: Final = os.environ.get("DB_NAME", "romm")
|
||||
|
||||
# REDIS
|
||||
REDIS_HOST: Final = "localhost"
|
||||
REDIS_HOST: Final = "127.0.0.1"
|
||||
REDIS_PORT: Final = 6379
|
||||
|
||||
# IGDB
|
||||
|
||||
@@ -149,7 +149,7 @@ def update_user(
|
||||
"hashed_password"
|
||||
)
|
||||
if request.user.id == id and creds_updated:
|
||||
auth_handler.clear_session(request)
|
||||
request.session.clear()
|
||||
|
||||
return db_user_handler.get_user(id)
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ class AuthHandler:
|
||||
# Key exists therefore user is probably authenticated
|
||||
user = db_user_handler.get_user_by_username(username)
|
||||
if user is None:
|
||||
conn.session.clear()
|
||||
conn.session = {}
|
||||
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
@@ -85,7 +85,7 @@ class AuthHandler:
|
||||
)
|
||||
|
||||
if not user.enabled:
|
||||
conn.session.clear()
|
||||
conn.session = {}
|
||||
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN, detail="Inactive user"
|
||||
|
||||
Reference in New Issue
Block a user