Skip to main content

maybe_encrypt

Function maybe_encrypt 

Source
pub fn maybe_encrypt(
    value: Option<String>,
    encrypt: bool,
    secret: &str,
) -> Result<Option<String>, AuthError>
Expand description

Conditionally encrypt a token value. Returns the original value when encryption is disabled, or the encrypted value when enabled.