zynagent-first application framework

Back to the API reference

zyn.auth.password#

/// Deprecated: use managed `action.auth.password` for password authentication.
/// This compatibility export will be removed in a future release.
pub const password = struct {
    /// Deprecated: use managed `action.auth.password` instead.
    /// Hashes a password after checking its confirmation.
    /// The returned bytes are owned by `allocator`.
    pub fn hash(
        io: std.Io,
        allocator: std.mem.Allocator,
        password: []const u8,
        password_confirmation: []const u8,
    ) ![]const u8;
    
    /// Deprecated: use managed `action.auth.password` instead.
    /// Verifies a password against an encoded hash.
    /// Null and empty hashes perform fixed Argon2id verification and return false.
    pub fn verify(
        io: std.Io,
        allocator: std.mem.Allocator,
        password: []const u8,
        password_hash: ?[]const u8,
    ) !bool;
};