Skip to main content

issue_user_session_with_fields

Function issue_user_session_with_fields 

Source
pub async fn issue_user_session_with_fields<S: AuthSchema>(
    ctx: &AuthContext<S>,
    user_id: &str,
    ip_address: Option<String>,
    user_agent: Option<String>,
    fields: SessionOverrides,
) -> Result<IssuedSession<S>, SessionIssueError>
Expand description

Issue a session with trusted fields applied during its initial insert.

Configured field policies and creation hooks receive the supplied fields; issuance publishes the resulting row through the normal cache and completion path. No follow-up session update is performed. Admin ban policy still applies.

ยงErrors

Returns an error if hooks reject issuance, the user is banned, or storage fails.