Adding fields to the signup form is more complex than just setting a custom :biff.auth/new-user-tx
function because both
authentication flows (email link and six-digit code) include multiple requests (e.g. in the email link flow, first you submit
a form with your email address, then you click a link), and new-user-tx
doesn't get called until the last request. So we
have to modify the auth flows to take the extra form params from the first request and propagate them so that new-user-tx
has access to them.
Below is a diff of the starter app showing exactly how to do that. First, you'll need to copy over the authentication module
code into your project, as demonstrated in
step 4 of the Postgres howto. Then apply the changes in the diff
below to your auth.clj
file. Remove the com.biffweb.impl.*
namespaces and use a single [com.biffweb :as biff]
require instead.