wasp icon indicating copy to clipboard operation
wasp copied to clipboard

Merge username & email `login` and `signup` actions

Open infomiho opened this issue 5 months ago • 1 comments

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
}

infomiho avatar Jan 30 '24 14:01 infomiho

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?

Martinsos avatar Jan 30 '24 14:01 Martinsos