Auth.js throws "Pending sign-in attempt already in progress" on login using Chrome

See original GitHub issue

Before opening, please confirm:

I have searched for duplicate or closed issues and discussions. I have read the guide for submitting bug reports. I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

JavaScript Framework

Angular

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

  System:
    OS: macOS 11.2.3
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 917.25 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.3 - ~/.nvm/versions/node/v14.15.3/bin/node
    npm: 7.6.3 - ~/.nvm/versions/node/v14.15.3/bin/npm
  Browsers:
    Chrome: 89.0.4389.114
    Chrome Canary: 92.0.4475.0
    Firefox: 79.0
    Firefox Developer Edition: 88.0
    Safari: 14.0.3
  npmPackages:
    @angular-builders/jest: ~11.1.1 => 11.1.1 
    @angular-devkit/build-angular: ^0.1102.5 => 0.1102.5 
    @angular-material-components/color-picker: ~5.0.2 => 5.0.2 
    @angular-material-extensions/password-strength: ^8.1.1 => 8.1.1 
    @angular/animations: ~11.2.6 => 11.2.6 
    @angular/cdk: ^11.2.5 => 11.2.5 
    @angular/cli: ~11.2.5 => 11.2.5 
    @angular/common: ~11.2.6 => 11.2.6 
    @angular/compiler: ~11.2.6 => 11.2.6 
    @angular/compiler-cli: ~11.2.6 => 11.2.6 
    @angular/core: ~11.2.6 => 11.2.6 
    @angular/flex-layout: ^11.0.0-beta.33 => 11.0.0-beta.33 
    @angular/forms: ~11.2.6 => 11.2.6 
    @angular/language-service: ~11.2.6 => 11.2.6 
    @angular/localize: ^11.2.6 => 11.2.6 
    @angular/material: ^11.2.5 => 11.2.5 
    @angular/material-moment-adapter: ~11.2.5 => 11.2.5 
    @angular/platform-browser: ~11.2.6 => 11.2.6 
    @angular/platform-browser-dynamic: ~11.2.6 => 11.2.6 
    @angular/router: ~11.2.6 => 11.2.6 
    @aws-amplify/analytics: ^4.0.17 => 4.0.17 
    @aws-amplify/api: ^3.2.29 => 3.2.29 
    @aws-amplify/auth: ^3.4.29 => 3.4.29 
    @aws-amplify/core: ^3.8.21 => 3.8.21 
    @aws-amplify/interactions: ^3.3.29 => 3.3.29 
    @aws-amplify/pubsub: ^3.2.27 => 3.2.27 
    @aws-amplify/storage: ^3.3.29 => 3.3.29 
    @aws-amplify/xr: ^2.2.29 => 2.2.29 
    @types/node: ^14.14.35 => 14.14.35 
    aws-amplify-angular: ^5.0.30 => 5.0.54 
    backoff-rxjs: ^6.3.3 => 6.5.7 
    codelyzer: ^6.0.1 => 6.0.1 
    core-js: ^3.6.4 => 3.9.1 
    crypto-js: ^4.0.0 => 4.0.0 
    http-status-codes: ^1.4.0 => 1.4.0 
    i18n-iso-countries: ^4.3.1 => 4.3.1 
    jwt-decode: ^2.2.0 => 2.2.0 
    roboto-fontface: ^0.10.0 => 0.10.0 
    rxjs: ^6.6.3 => 6.6.6 
    sass: ~1.32.6 => 1.32.8 
    ts-jest: ~26.5.4 => 26.5.4 
    ts-node: ~9.0.0 => 9.0.0 
    tslib: ^2.0.0 => 2.1.0 
    tslint: ~6.1.3 => 6.1.3 
    typescript: ~4.1.5 => 4.1.5 
    uuid: ^8.3.0 => 8.3.2 
    wait-on: ^5.2.0 => 5.3.0 
    zone.js: ~0.10.2 => 0.10.3 
  npmGlobalPackages:
    @angular/cli: 11.2.5
    json-server: 0.16.3
    npm: 7.6.3

Describe the bug

On login using the “normal” login (username and password) the following issue occurs:

The login isn’t effected by this behavior.

core.js:6162 ERROR Error: Pending sign-in attempt already in progress
    at AuthClass.push.v4IS.AuthClass.signInWithPassword (Auth.js:529)
    at AuthClass.push.v4IS.AuthClass.signIn (Auth.js:415)
    at AuthClass.Auth.signIn (auth.decorator.js:35)
    at AuthClass.Auth.signIn (auth.decorator.js:35)
    at LoginComponent.submit (login.component.ts:90)

Expected behavior

Login without any error messages, thrown by Auth.js

Reproduction steps

I was only able to reproduce this bug using Chrome.

  1. login by username and password
  2. Error occurs :sad

Code Snippet

this.amplifyService.auth().signIn({username, password}))

Log output

// Put your logs below this line


Related Issues:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bilsak18commented, Apr 22, 2021

@chrisbonifacio Thank you for investigating the issue. On my side, I refactored my code very often, trying to find some solution to this issue, and so I lost the current error in the refactoring process and was only left with the second error like I explained it in my first comment above, which doesn’t appear all the time.

I figured lately that it’s only a matter of timeout of the Auth.signIn request when executed in the Cypress environment. Since Cypress by default times out its commands after 4 seconds, and since my Auth.signIn call SOMETIMES takes longer to resolve well the test fails and I never see my Auth.signIn request resolving. This doesn’t happen all the time, cause SOME OTHER TIMES the Auth.signIn resolves quicker than the 4 seconds timeout and everything works out just fine.

NOTE: This only happens in my test environment. My live app works fine all the time.

0reactions
chrisbonifaciocommented, May 27, 2021

@Sebastian-G Closing this issue for now as we have not heard back from you in nearly a month.

@rraczae We’re unable to consistently reproduce this issue with a properly configured Auth. This issue is more than likely caused by Auth being misconfigured, which could be a red herring because usually the real cause is some discrepancy with package versions and/or the amazon-cognito-identity-js package not being linked properly.

If you can, try to go through the steps here and see if it helps

https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS Amplify customized Auth sign-in gets stock (pending ...
I have upgraded the Amplify packages as explained here, but it did not help. Pending sign-in attempt already in progress at node_modules/@aws- ...
Read more >
Authenticate Using Google with JavaScript - Firebase
// Step 1. // User tries to sign in to Google. ... // An error happened. ... // Step 2. // User's email...
Read more >
FirebaseUI for Web — Auth - Firebase Open Source
FirebaseUI Auth provides a drop-in auth solution that handles the UI flows for signing in users with email addresses and passwords, phone numbers,...
Read more >
How to Set Up GitHub User Authentication using Firebase and ...
In this tutorial, I will walk you through the process of creating a GitHub User Authentication System using Firebase and React (with hooks)....
Read more >
Linking multiple providers to an account | Identity Platform ...
Sign in the user with any authentication provider or method. ... If a user attempts to sign in with credentials that are already...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found