aws-cognito icon indicating copy to clipboard operation
aws-cognito copied to clipboard

user is always null when using API guard

Open minkbear opened this issue 7 months ago • 0 comments

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

minkbear avatar Jul 17 '24 08:07 minkbear