Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

daniel-de-wit
Copy link
Owner

@daniel-de-wit daniel-de-wit commented Jun 16, 2022

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
Copy link

coveralls commented Jun 16, 2022

Pull Request Test Coverage Report for Build 2507820124

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

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 99.541%

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

💛 - Coveralls

@daniel-de-wit daniel-de-wit requested review from wimski and removed request for wimski June 20, 2022 07:09
@daniel-de-wit daniel-de-wit force-pushed the configurable-credential-keys branch 3 times, most recently from 8d9fdb9 to 1e682b7 Compare June 20, 2022 07:28
@daniel-de-wit daniel-de-wit merged commit ac468c8 into master Jun 20, 2022
@daniel-de-wit daniel-de-wit deleted the configurable-credential-keys branch June 20, 2022 09:53
This was referenced Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to change email to username
3 participants