@@ -17,19 +17,22 @@ impl RedisManager {
1717 access_token : & str ,
1818 refresh_token : & str ,
1919 user_id : i64 ,
20+ username : & str ,
2021 sealing_key : & str ,
2122 role : & UserRole ,
2223 ) -> Result < ( ) , Error > {
2324 let access_token_item = RedisAccessToken {
2425 access_token : access_token. to_string ( ) ,
2526 user_id,
27+ username : username. to_string ( ) ,
2628 sealing_key : sealing_key. to_string ( ) ,
2729 role : role. clone ( ) ,
2830 } ;
2931 let refresh_token_item = RedisRefreshToken {
3032 refresh_token : refresh_token. to_string ( ) ,
3133 kind : RedisRefreshTokenKind :: Active ( RedisActiveRefreshToken {
3234 user_id,
35+ username : username. to_string ( ) ,
3336 sealing_key : sealing_key. to_string ( ) ,
3437 role : role. clone ( ) ,
3538 } ) ,
@@ -66,6 +69,7 @@ impl RedisManager {
6669 let key = RedisAccessToken {
6770 access_token : access_token. to_string ( ) ,
6871 user_id : 0 ,
72+ username : String :: new ( ) ,
6973 sealing_key : String :: new ( ) ,
7074 role : UserRole :: Customer ,
7175 }
@@ -88,6 +92,7 @@ impl RedisManager {
8892 refresh_token : refresh_token. to_string ( ) ,
8993 kind : RedisRefreshTokenKind :: Active ( RedisActiveRefreshToken {
9094 user_id : 0 ,
95+ username : String :: new ( ) ,
9196 sealing_key : String :: new ( ) ,
9297 role : UserRole :: Customer ,
9398 } ) ,
@@ -109,6 +114,7 @@ impl RedisManager {
109114 fresh_access_token : & str ,
110115 fresh_refresh_token : & str ,
111116 user_id : i64 ,
117+ username : & str ,
112118 sealing_key : & str ,
113119 role : & UserRole ,
114120 ) -> Result < ( ) , Error > {
@@ -122,13 +128,15 @@ impl RedisManager {
122128 let access_token_item = RedisAccessToken {
123129 access_token : fresh_access_token. to_string ( ) ,
124130 user_id,
131+ username : username. to_string ( ) ,
125132 sealing_key : sealing_key. to_string ( ) ,
126133 role : role. clone ( ) ,
127134 } ;
128135 let refresh_token_item = RedisRefreshToken {
129136 refresh_token : fresh_refresh_token. to_string ( ) ,
130137 kind : RedisRefreshTokenKind :: Active ( RedisActiveRefreshToken {
131138 user_id,
139+ username : username. to_string ( ) ,
132140 sealing_key : sealing_key. to_string ( ) ,
133141 role : role. clone ( ) ,
134142 } ) ,
@@ -172,6 +180,7 @@ impl RedisManager {
172180 refresh_token : refresh_token. to_string ( ) ,
173181 kind : RedisRefreshTokenKind :: Active ( RedisActiveRefreshToken {
174182 user_id : 0 ,
183+ username : String :: new ( ) ,
175184 sealing_key : String :: new ( ) ,
176185 role : UserRole :: Customer ,
177186 } ) ,
0 commit comments