pub struct AuthInfo {
pub user_id: Option<String>,
pub is_admin: bool,
pub tenant_id: Option<String>,
}Expand description
Auth context passed to function handlers.
Mirrors the three fields of the runtime’s AuthContext that a
mutation can legitimately read: the authenticated user id, admin
flag, and active tenant. Functions that gate on ctx.auth.tenantId
(anything org-scoped in a B2B app) need the last one forwarded — it’s
easy to forget and catches out every new multi-tenant example until
someone hits “why is my session_tenant always null inside functions”.
Fields§
§user_id: Option<String>§is_admin: bool§tenant_id: Option<String>Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthInfo
impl<'de> Deserialize<'de> for AuthInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthInfo
impl RefUnwindSafe for AuthInfo
impl Send for AuthInfo
impl Sync for AuthInfo
impl Unpin for AuthInfo
impl UnsafeUnpin for AuthInfo
impl UnwindSafe for AuthInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more