Skip to content

Commit

Permalink
Update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
deleugpn committed Oct 14, 2020
1 parent 41c12c3 commit 5e90a3b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,21 @@ Cognito Environment Variables

Configure the `auth` middleware at `App\Http\Kernel` with `'auth:cognito-token'`

### UserFactory

The last thing you'll need is to provide your own implementation of `UserFactory` and register it in a ServiceProvider.

final class CognitoUserFactory implements UserFactory
{
public function make(array $payload): ?Authenticatable
{
return new MyUserObject(
$payload['username'],
$payload['custom:my_custom_cognito_attribute'],
);
}
}

```
$this->app->bind(CustomerGauge\Cognito\Contracts\UserFactory, App\Auth\CognitoUserFactory::class);
```

0 comments on commit 5e90a3b

Please sign in to comment.