Skip to main content

## profiles_set_pin

# Function profiles_set_pin

Source

    pub async fn profiles_set_pin(
        db: State<'_, DatabaseWrapper>,
        user_id: String,
        current_pin: Option<String>,
        new_pin: Option<String>,
    ) -> Result<(), String>

Expand description

Set, change, or clear a profile’s PIN.

Changing an existing PIN requires the current one. Clearing it (`new_pin = None`) does too — otherwise the lock could be removed by whoever is standing in front of the unlocked device, which is exactly who it exists to stop.

TRACES: UR-083 | DR-268