feat: ability to login with email, username or both (#7086)

`auth.loginWithUsername`:

```ts
auth: {
  loginWithUsername: {
    allowEmailLogin: true, // default: false
    requireEmail: false, // default: false
  }
}
```

#### `allowEmailLogin`
This property will allow you to determine if users should be able to
login with either email or username. If set to `false`, the default
value, then users will only be able to login with usernames when using
the `loginWithUsername` property.

#### `requireEmail`
Require that users also provide emails when using usernames.
This commit is contained in:
Jarrod Flesch
2024-07-18 10:29:44 -04:00
committed by GitHub
parent a3af3605f0
commit 7b3b02198c
67 changed files with 1675 additions and 1125 deletions

View File

@@ -207,6 +207,6 @@ export interface Auth {
declare module 'payload' {
// @ts-ignore
// @ts-ignore
export interface GeneratedTypes extends Config {}
}
}