daniel-de-wit / lighthouse-sanctum

Laravel Sanctum support for Laravel Lighthouse
MIT License
56 stars 9 forks source link

Ability to customize credential keys e.g: email/username #77

Closed daniel-de-wit closed 2 years ago

daniel-de-wit commented 2 years ago

Closes #76

A new section is added to config/lighthouse-sanctum.php which allows for custom user identification field to be used when authenticating.

For example, using username instead of the default email.

/*
|--------------------------------------------------------------------------
| Identification
|--------------------------------------------------------------------------
|
| Configure the credential fields by which the user will be identified.
| Default: email
*/

'user_identifier_field_name' => 'username',

Update the GraphQL schema accordingly

input LoginInput {
    username: String! @rules(apply: ["required"])
}
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 2527314905

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 1940564576: 0.02%
Covered Lines: 217
Relevant Lines: 218

💛 - Coveralls