ash-project / ash_phoenix

Utilities for integrating Ash and Phoenix

Home Page:https://hexdocs.pm/ash_phoenix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An ability to drop some values from the form struct

minibikini opened this issue · comments

As per Discord discussion:

Is your feature request related to a problem? Please describe.

I've noticed that AshPhoenix.Form persists data if there were errors, which makes sense, but sometimes it could be sensitive data like passwords. I'd like to scrub them from the form struct.

Describe the solution you'd like
Perhaps drop values which marked as sensetive?: true.

Or maybe add clear_value(form, list_of_fields_to_clear) function for this.

Describe alternatives you've considered
Drop those values manually from the form struct.

I've released this as a simple utility that can be used to clear values on a form, i.e AshPhoenix.Form.clear_value(form, field_or_fields)