Skip to content

Commit e17263b

Browse files
authored
Merge pull request #50 from joselfonseca/hotfix/42-use-config-to-get-user
Hotfix: use the config to get the user and log in after registration
2 parents f2b461e + f427360 commit e17263b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/GraphQL/Mutations/Register.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ public function resolve($rootValue, array $args, GraphQLContext $context = null,
2727
$model->fill($input);
2828
$model->save();
2929
$credentials = $this->buildCredentials([
30-
'username' => $args['email'],
30+
'username' => $args[config('lighthouse-graphql-passport.username')],
3131
'password' => $args['password'],
3232
]);
33-
$user = $model->where('email', $args['email'])->first();
33+
$user = $model->where(config('lighthouse-graphql-passport.username'), $args[config('lighthouse-graphql-passport.username')])->first();
3434
$response = $this->makeRequest($credentials);
3535
$response['user'] = $user;
3636
event(new Registered($user));

src/GraphQL/Mutations/ResetPassword.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ResetPassword
1717
{
1818
use ResetsPasswords;
1919
use ValidatesRequests;
20+
2021
/**
2122
* @param $rootValue
2223
* @param array $args

0 commit comments

Comments
 (0)