Skip to content

Commit 2832d09

Browse files
committed
fix(sidebar): logout cookies and case insensitive usernames
1 parent 8b07e69 commit 2832d09

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

testgen/ui/assets/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ header {
4747
/* ... */
4848

4949
/* Sidebar */
50+
[data-testid="stSidebarHeader"] {
51+
padding: 16px 20px;
52+
}
53+
5054
section[data-testid="stSidebar"] {
5155
width: 250px;
5256
z-index: 999;

testgen/ui/components/frontend/js/components/sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ stylesheet.replace(`
251251
display: flex;
252252
flex-direction: column;
253253
justify-content: space-between;
254-
height: calc(100% - 78px);
254+
height: calc(100% - 64px);
255255
}
256256
257257
.menu .menu--project {

testgen/ui/components/widgets/sidebar.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import time
23
from typing import Literal
34

45
from testgen.ui.components.utils.component import component
@@ -70,6 +71,9 @@ def on_change():
7071
javascript_service.clear_component_states()
7172
user_session_service.end_user_session()
7273
Router().queue_navigation(to="")
74+
# Without the time.sleep, cookies sometimes don't get cleared on deployed instances
75+
# (even though it works fine locally)
76+
time.sleep(0.3)
7377
else:
7478
Router().queue_navigation(
7579
to=event_data.get("path") or session.user_default_page,

testgen/ui/services/user_session_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_auth_data():
7878
preauthorized_list = []
7979

8080
for item in auth_data.itertuples():
81-
usernames[item.username] = {
81+
usernames[item.username.lower()] = {
8282
"email": item.email,
8383
"name": item.name,
8484
"password": item.password,

0 commit comments

Comments
 (0)