wasp
wasp copied to clipboard
Merge username & email `login` and `signup` actions
We now have defined login
and signup
twice, once for email
and once for username
auth methods.
We should have only one template file for each of the methods and template the fields inside of them.
Example
Instead of having username/login.ts
and email/login.ts
have auth/login.ts
with something like this:
{=# isUsernameEnabled =}
type Data = { username: string; password: string; }
{=/ isUsernameEnabled =}
{=# isEmailEnabled =}
type Data = { email: string; password: string; }
{=/ isEmailEnabled =}
export function login(
data: Data
) {
// ... logic
}
We might also want to consider case in which we might in the future have both username and email enabled? Would that ever make sense -> I guess not, you have to pick one? It would also complicate our signup / login forms?