joselfonseca / lighthouse-graphql-passport-auth

Add GraphQL mutations to get tokens from passport for https://lighthouse-php.com/
https://lighthouse-php-auth.com/
MIT License
231 stars 55 forks source link

Issue/find user model by method #88

Closed DiskoPete closed 4 years ago

DiskoPete commented 4 years ago

First of all, thanks for this awesome package.

I am using it for the first time on a current project and ran into a limitation.\ I wanted to give the users the ability to login with either email or username.

Since the package is tightly coupled to laravel passport, I was wondering why not to optionally use the findForPassport method on the auth model to have more control of the retrieval of the user instance: https://laravel.com/docs/7.x/passport#customizing-the-username-field

Since the new feature does not introduce a breaking change, I am still a bit concerned if this addition might have side effects for existing codebases.

Looking forward to your feedback!

Best,\ Peter

Additional changes I made to the codebase

joselfonseca commented 4 years ago

Hey @DiskoPete this looks great, just need to fix some code style from Style CI.

Could you please take a look at https://github.styleci.io/analyses/4xbgM1?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link and fix any styling errors so we can test and merge.

Thanks!

DiskoPete commented 4 years ago

Thanks @joselfonseca 🙂

The style fixes from styleci are applied now. I tried to run composer check-style and composer fix-style like mentioned in the CONTRIBUTING.md but these scripts weren't available for me. 🤔