Updated refresh token endpoint to enable rotation
This commit is contained in:
@@ -150,11 +150,10 @@ impl FromRequest for JwtAuth {
|
||||
};
|
||||
let user_email = match conn.get::<_, String>(access_token_uuid.clone().to_string()) {
|
||||
Ok(result) => result,
|
||||
Err(err) => {
|
||||
error!("Failed to get access token from redis: {}", err);
|
||||
Err(_) => {
|
||||
return ready(Err(ActixError::from(ServiceError {
|
||||
status: 500,
|
||||
message: format!("Failed to get access token from redis: {}", err)
|
||||
status: 404,
|
||||
message: format!("Access token was not found")
|
||||
})))
|
||||
}
|
||||
};
|
||||
@@ -163,9 +162,9 @@ impl FromRequest for JwtAuth {
|
||||
Ok(user) => {
|
||||
ready(Ok(JwtAuth { token: access_token_uuid, user: user.into() }))
|
||||
}
|
||||
Err(err) => return ready(Err(ActixError::from(ServiceError {
|
||||
status: 500,
|
||||
message: format!("Failed to get user from db: {}", err)
|
||||
Err(_) => return ready(Err(ActixError::from(ServiceError {
|
||||
status: 404,
|
||||
message: format!("User was not found")
|
||||
})))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user