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
229 stars 56 forks source link

refactor: put auth model creation in a separate method #90

Closed DiskoPete closed 4 years ago

DiskoPete commented 4 years ago

Since I didn't want to make the password field fillable on my user model, I thought about having a similar approach to the default RegisterController.

This will make it possible to extend the Register resolver and customize the model creation.

I expect no breaking change from this modification.

Looking forward to your feedback! 🙂 Thanks!

DiskoPete commented 4 years ago

Also if we are making the user model from a factory, can that also be applied to the login ? right now the login also has methods to make or create the user class.

Correct. You got me here 😄

I was a bit short on time and didn't go for the extra mile. Will fix this.

DiskoPete commented 4 years ago

@joselfonseca I addressed you feedback. Thanks for having another look.

🙂

DiskoPete commented 4 years ago

hi @joselfonseca

Did you already had time to have another look at the pull request?

Cheers

joselfonseca commented 4 years ago

@DiskoPete seems that the branch is out of date. Can you please update your branch and then i'll take a look.

Thanks.

DiskoPete commented 4 years ago

@joselfonseca I updated the branch. Thanks!