logo
Updated

Better Auth

Code

// for customizing schema
function withApplyDefault(
  value: unknown,
  field: FieldAttribute,
  action: "create" | "update",
) {
  if (action === "update") return value

  if (value === undefined || value === null)
    if (field.defaultValue) {
      if (typeof field.defaultValue === "function") return field.defaultValue()

      return field.defaultValue
    }

  return value
}

Notes

Links

Beka Cru - oss/acc
convex adapter by @PingStruggles you can now use @convex_dev with better auth. May not be the prettiest integration but if you were planning to try it out a good starting point. https://t.co/rBvHXxxEMR