From 0910ade371642dcc1463d4b1e3593afc74af6eda Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 8 Oct 2025 23:09:29 -0500 Subject: [PATCH] more fixes for refresh token - this time maintaining the username and role properly across refresh --- .../__pycache__/routes_auth.cpython-313.pyc | Bin 7480 -> 7546 bytes backend/app/api/v1/routes_auth.py | 4 +++- .../schemas/__pycache__/auth.cpython-313.pyc | Bin 3786 -> 3866 bytes backend/app/schemas/auth.py | 4 ++++ frontend/src/lib/auth.ts | 4 ++-- frontend/src/types/api.ts | 2 ++ 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/app/api/v1/__pycache__/routes_auth.cpython-313.pyc b/backend/app/api/v1/__pycache__/routes_auth.cpython-313.pyc index 4eb388e5fce8ba86edb890f8d8d3a819b6987c08..112e3ecc8f46d999e7460c9ef095a315c51258c1 100644 GIT binary patch delta 762 zcmYk3%TF3X9LHyNc`lENJc>}FB#i-4u4s07-l3rM)!0 z**SRVxk*iWY4)PMm>MtYKR~$HThkjY98A+g=Z7VBlKJd+zQ6A#-^uL9f5*)|lSx2q zr6S+ArktP6iVpjgBi$s%VfsTqgG1CKyu{1Od%@4S7g?~vL;T-@UthD``=gv2->Te3 zgo@g=>EZb5d&f@SSOP9K3}2Z;#oQ>}QCTx%G4)NPL$~qDf)|x$hjT3|*AbG0l6vUe zbCnW9T@)htQm-Xx-*U@3E*btydWwd%3|-Z_l)~sb=k=>eh^5I40J@NIhK~Met5$m? zmFrdd!B%+?VV>XH(N<*nnOJRf_|0mQL?NhpBFi-bMTianHHZZe1H=JVz#QNjU<8l> zm;hP&*zSy8XR;%R4N+<|%TlF!*(D8uAOKpCbqMKm&nwmKrYK9~F5R z9qFe*Ga_`6MlbwIAzSLAU!c3rRu=la%6Rfg{B>g9y~Ls81YS(5j*~f#9Zu#jo1COE z)2Ez}kMXC*j4vPN&%$bUIE(T5q;h}Ehi9`;XdbWt$N?M-emuBH10HaK6c{_2n!G8u znxw)GAC)hzhuF2unyyG4zj;9n%eq7DE6 delta 698 zcmZvZO=uHA6vt<>n{Ki-X+D~bNxPVetw|Gtw2h`|LqF0F+nAK5=2Q^kHq^zKEt3uC zK?L=pw=zdP3xXHfi#-)fFQHct5-2JnqNmjqD&oO;tHp~0^W*>i@68+D%+JiLjJxA< ziHNPkkc3D^a0zQH^#eD zk9on3P+2G?={E1ThsL>ch(7cVd)6%JK#RC|VF0a<(XU=PaOtE+Sxn(Sx|F809XVB8QP-SQ0r$KdZn&ZNeb*~ zKmu~k`P)i$OINizS*6E;^U)PZ$pCmmG6Y4!R^?7jt89=lu=0Q_bU~WM1^P(3g{O^U zX%8p1L*E46BbtbJie?v@%HdsgN8QzSw158hEb7hvIJ!(foo*JP(ft`YAH}aDxxS?& z+MmEnaejYtPGUjJhgqiO4}u=HbR2_DiupmVm7a;_Biup6&VqwME*~|XhN3wAzn75M zJuz$z)qoF-kOE`7tEO#gO`Rw#cxLI|w$bQ$7+vb~t1kH*J=?L5p(YH^+;ehyVZp diff --git a/backend/app/api/v1/routes_auth.py b/backend/app/api/v1/routes_auth.py index 5e5c10b..0ee1b0f 100644 --- a/backend/app/api/v1/routes_auth.py +++ b/backend/app/api/v1/routes_auth.py @@ -150,7 +150,9 @@ async def refresh_token( return RefreshResponse( access_token=new_access_token, user_id=user_id, - role=user.role if isinstance(user.role, str) else user.role.value + role=user.role if isinstance(user.role, str) else user.role.value, + email=user.email, + full_name=user.full_name ) except Exception as e: diff --git a/backend/app/schemas/__pycache__/auth.cpython-313.pyc b/backend/app/schemas/__pycache__/auth.cpython-313.pyc index e25bb998bdb898a723bccd7ead7d0c51f9c0aa4d..aba36ac574c41ae20182b15d912f69152711c97c 100644 GIT binary patch delta 339 zcmX>lJ4=rDGcPX}0}$AnKF>I}k(Y~QvJi*dWGQAPnHZKB)?jvZpd6UR0b&Jn7O|&u zX>w2YW>J%r1qu|&fe3COaf>spG$$uMFEKZDasi7bquS&f%(6Vqo;SGpn!RrD3$^)8 zUe6NEC_R~*)rnDkvLCAwmnujvh>)IK#VW<9I{6>7nK_5qR-JaZV` mCvWB103_3R>)F80)|~vBw}6L@QFub;7X~2pMQCz5Uorp`Vo>D( delta 355 zcmbOwcS@G`GcPX}0}!PDT$s_jk(Y~wQE&1+ZpF!R%v>D7tVQhUY?|zoi&@mzd4Y=j zisUCVatKd8%fcrs1mw3f+z=AI%p!V2Os>Ie0`oN%xgt@ZaFOEVf6S7TRavbW#V04S zI((set) => ({ // Reconstruct user from refresh response const user: User = { id: response.user_id, - email: '', // Will be populated if needed - full_name: '', + email: response.email, + full_name: response.full_name, role: response.role as UserRole, is_active: true, created_at: '', diff --git a/frontend/src/types/api.ts b/frontend/src/types/api.ts index bf0e7a1..5dc04a8 100644 --- a/frontend/src/types/api.ts +++ b/frontend/src/types/api.ts @@ -98,6 +98,8 @@ export interface RefreshResponse { token_type: string; user_id: string; role: string; + email: string; + full_name: string; } export interface JobCreateRequest {