╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │159 const user_map = try DB.HashMap(.read_only).init(user_cursor); │ │160 const user_event = try evt.read(Record, DB, hash_kind, arena, user_map); │ │161 │ │162 - bcrypt.strVerify(user_event.event.password_hash, password, .{ .silently_truncate_password = false }) catch {│ │163 - return .wrong_password; │ │164 - }; │ │162 + if (!verifyPassword(user_event.event.password_hash, password)) return .wrong_password; │ │163 │ │164 return .{ .success = user_id }; │ │165 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │166 │ │167 +pub fn verifyPassword(password_hash: []const u8, password: []const u8) bool { │ │168 + bcrypt.strVerify(password_hash, password, .{ .silently_truncate_password = false }) catch return false;│ │169 + return true; │ │170 +} │ │171 + │ │172 // read a user by event id via the event-id->user index, or null if the id │ │173 // isn't a known user. field byte slices are allocated in `arena`. │ │174 pub fn readById( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯