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

Login is redirected and fails #57

Closed danieljbrennan closed 1 year ago

danieljbrennan commented 1 year ago

Describe the bug When I attempt login from Vue application frontend, nothing happens. The call response is empty, then another get request occurs. This is probably not important. Digging into the code, I can see that the EloquentUserProvider is trying to run a DB query. I think this provider should not be in use at all.

To Reproduce Steps to reproduce the behavior:

  1. I copied the AuthController.php from your demo project
  2. I created a route in Laravel to call AuthController->attemptLogin
  3. I directed my Vue application to call this route and send 'email' and 'password'
  4. The response is empty and then another call occurs

Expected behavior There should be some response. Logged in, invalid, whatever.

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A Additional context N/A

danieljbrennan commented 1 year ago

Update: I switched to use the "api" auth, which I think might be correct, but the result is only slightly better: image

amitdhongde commented 1 year ago

Hi @danieljbrennan, Thank you for the query. The plugin here requires the local DB connection for Laravel level user object creation. You will need to run the migrations and connect to a DB to make the code execute.

Thank you for pointing out the issue with the demo site, let me check and have that fixed at earliest.

amitdhongde commented 1 year ago

Hey @danieljbrennan, The demo url is working fine.

amitdhongde commented 1 year ago

Try this and it should work for you https://github.com/ellaisys/aws-cognito/discussions/31#discussioncomment-3182310

danieljbrennan commented 1 year ago

Hi and thanks very much. I eventually figured out I needed a database, but I'm not using one. So an writing own guard and grabbing bits from you and black-bits. Thanks for publishing this!