ellaisys / aws-cognito

AWS Cognito package (with MFA Feature) using the AWS SDK for PHP/Laravel
https://ellaisys.github.io/aws-cognito/
MIT License
110 stars 41 forks source link

user is always null when using API guard #106

Open minkbear opened 2 months ago

minkbear commented 2 months ago

Describe the bug using API guard, user property is always null.

To Reproduce Steps to reproduce the behavior:

  1. Download demo and setup site
  2. use postman and POST to api/user/login get access token
  3. use postman and GET to api/user/profile
  4. unable to get user models

I take a look closer on https://github.com/ellaisys/aws-cognito/blob/master/src/Guards/CognitoTokenGuard.php#L373 so I set primaryKey = "sub" in user models. The problem is gone. and no docs here.

Expected behavior able to get user models when using API guard