Implemented refresh token
This commit is contained in:
@@ -100,9 +100,8 @@ impl From<QueryUser> for ResponseUser {
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct JwtAuth {
|
||||
pub access_token_uuid: uuid::Uuid,
|
||||
pub email: String,
|
||||
pub role: String,
|
||||
pub token: uuid::Uuid,
|
||||
pub user: ResponseUser
|
||||
}
|
||||
|
||||
impl FromRequest for JwtAuth {
|
||||
@@ -162,7 +161,7 @@ impl FromRequest for JwtAuth {
|
||||
|
||||
match QueryUser::get_by_email(&user_email) {
|
||||
Ok(user) => {
|
||||
ready(Ok(JwtAuth { access_token_uuid, email: user.email, role: user.role }))
|
||||
ready(Ok(JwtAuth { token: access_token_uuid, user: user.into() }))
|
||||
}
|
||||
Err(err) => return ready(Err(ActixError::from(ServiceError {
|
||||
status: 500,
|
||||
|
||||
Reference in New Issue
Block a user