File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -171,9 +171,9 @@ pub async fn login(
171
171
172
172
pub async fn create_refresh_token (
173
173
state : & web:: Data < AppState > ,
174
- uid : uuid:: Uuid ,
174
+ user_id : uuid:: Uuid ,
175
175
) -> actix_web:: Result < String > {
176
- let session_id = uuid:: Uuid :: new_v4 ( ) ;
176
+ let token_id = uuid:: Uuid :: new_v4 ( ) ;
177
177
let mut conn = get_connection ( state) ?;
178
178
179
179
let now = Utc :: now ( ) ;
@@ -187,17 +187,17 @@ pub async fn create_refresh_token(
187
187
let claims = TokenClaims {
188
188
iat,
189
189
exp,
190
- sub : session_id . to_string ( ) ,
190
+ sub : token_id . to_string ( ) ,
191
191
} ;
192
192
web_block_unpacked ( move || {
193
- use db_connector:: schema:: refresh_tokens:: dsl:: * ;
193
+ use db_connector:: schema:: refresh_tokens:: dsl as refresh_tokens ;
194
194
195
195
let token = RefreshToken {
196
- id : session_id ,
197
- user_id : uid ,
196
+ id : token_id ,
197
+ user_id,
198
198
expiration : exp as i64 ,
199
199
} ;
200
- match diesel:: insert_into ( refresh_tokens)
200
+ match diesel:: insert_into ( refresh_tokens:: refresh_tokens )
201
201
. values ( & token)
202
202
. execute ( & mut conn)
203
203
{
You can’t perform that action at this time.
0 commit comments