Closed muresanandrei closed 7 years ago
Do you have a User in the DB that matches the email/password you’re trying to Auth?
You mean not on aws db?
Correct - Cognito is not treated as a "database of users", and is only used to authorize the users. A request to cognito is not made unless the user exists in the apps DB.
So I also have to save the user on users table on my own db thanks.
Thanks @zoul0813, this is clearly not obvious from the documentation, we'll try and make this clearer.
@muresanandrei This way allows you to still maintain a database of users yourself for any extra details or links to other models etc.
I've added some additional documentation to the readme to help clarify this point.
https://github.com/pallant/laravel-aws-cognito-auth/tree/v1.1.2#users-table
When i try to login I get the following error:
Type error: Argument 1 passed to Pallant\LaravelAwsCognitoAuth\AwsCognitoIdentityGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given, called in /Users/andrei/Projects/Projects_2/project/vendor/pallant/laravel-aws-cognito-auth/src/AwsCognitoIdentityGuard.php on line 446
This is the login code:
$attempt = Auth::attempt([ 'email' => $request['email'], 'password' => $request['password'], ], false, AWS_COGNITO_AUTH_RETURN_ATTEMPT);