Added initial authorization layer.

This commit is contained in:
2026-10-09 17:22:46 +02:00
parent 7fb3abc93d
commit 1f6de34e5b
16 changed files with 184 additions and 64 deletions
+1 -7
View File
@@ -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
}
}