Added initial authorization layer.
This commit is contained in:
@@ -45,8 +45,7 @@ where
|
||||
.ok_or(AppError::Unauthorized)?;
|
||||
|
||||
Ok(Auth(Authorization {
|
||||
user_id: token.id,
|
||||
app_id: None,
|
||||
user_id: token.user_id,
|
||||
}))
|
||||
}
|
||||
}
|
||||
@@ -54,15 +53,10 @@ where
|
||||
#[derive(Debug)]
|
||||
pub struct Authorization {
|
||||
user_id: Uuid,
|
||||
app_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
impl Authorization {
|
||||
pub fn user_id(&self) -> Uuid {
|
||||
self.user_id
|
||||
}
|
||||
|
||||
pub fn app_id(&self) -> Option<Uuid> {
|
||||
self.app_id
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user