wasp/auth/providers
Types of the extra signup fields you define for your auth methods.
When you define userSignupFields for the Email or Username & password auth
method (see
Customizing the signup process),
Wasp infers the type of the extra fields from it and exports it from this
module. Each type only exists if you define userSignupFields for its auth
method. Social auth methods don't have a type here.
Type Aliases
UserEmailSignupFields
UserEmailSignupFields =
object
The extra signup fields of the Email auth method.
It's an object with one property for each field you defined in
auth.methods.email.userSignupFields, typed with the awaited return type of
that field's function. It's also part of the input of the email
signup
function from wasp/client/auth.
Index Signature
[field: string]: unknown
Example
If your User entity has an address field and you define:
import { defineUserSignupFields } from "wasp/server/auth";
export const userSignupFields = defineUserSignupFields({
address: (data) => {
if (typeof data.address !== "string") {
throw new Error("Address is required");
}
return data.address;
},
});
UserEmailSignupFields is { address: string }.
UserUsernameAndPasswordSignupFields
UserUsernameAndPasswordSignupFields =
object
The extra signup fields of the Username & password auth method.
It has the same shape as UserEmailSignupFields, with one property
for each field you defined in
auth.methods.usernameAndPassword.userSignupFields. It's also part of the
input of the username and password
signup
function from wasp/client/auth.
Index Signature
[field: string]: unknown