Skip to content

Password attempts exceeded needs its own error code from Cognito. #8554

Open
@Upgradedspicy

Description

@Upgradedspicy

Before opening, please confirm:

JavaScript Framework

Angular

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

# Put output below this line
System:
    OS: Windows 10 10.0.21390
    CPU: (6) x64 Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
    Memory: 5.59 GB / 15.94 GB
  Binaries:
    Node: 12.18.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.11 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Chrome: 91.0.4472.124
    Edge: Spartan (44.21390.1.0), Chromium (91.0.864.64)
    Internet Explorer: 11.0.21390.1
  npmPackages:
    @angular-devkit/build-angular: ~0.1102.2 => 0.1102.2
    @angular/animations: ^11.2.6 => 11.2.6
    @angular/animations/browser:  undefined ()
    @angular/animations/browser/testing:  undefined ()
    @angular/cdk: ^11.2.5 => 11.2.5
    @angular/cdk/a11y:  undefined ()
    @angular/cdk/accordion:  undefined ()
    @angular/cdk/bidi:  undefined ()
    @angular/cdk/clipboard:  undefined ()
    @angular/cdk/coercion:  undefined ()
    @angular/cdk/collections:  undefined ()
    @angular/cdk/drag-drop:  undefined ()
    @angular/cdk/keycodes:  undefined ()
    @angular/cdk/layout:  undefined ()
    @angular/cdk/observers:  undefined ()
    @angular/cdk/overlay:  undefined ()
    @angular/cdk/platform:  undefined ()
    @angular/cdk/portal:  undefined ()
    @angular/cdk/scrolling:  undefined ()
    @angular/cdk/stepper:  undefined ()
    @angular/cdk/table:  undefined ()
    @angular/cdk/testing:  undefined ()
    @angular/cdk/testing/protractor:  undefined ()
    @angular/cdk/testing/testbed:  undefined ()
    @angular/cdk/text-field:  undefined ()
    @angular/cdk/tree:  undefined ()
    @angular/cli: ~11.2.2 => 11.2.2
    @angular/common: ^11.2.3 => 11.2.3
    @angular/common/http:  undefined ()
    @angular/common/http/testing:  undefined ()
    @angular/common/testing:  undefined ()
    @angular/common/upgrade:  undefined ()
    @angular/compiler: ~11.2.3 => 11.2.3 (9.0.0)
    @angular/compiler-cli: ~11.2.3 => 11.2.3
    @angular/compiler/testing:  undefined ()
    @angular/core: ^11.2.3 => 11.2.6 (9.0.0)
    @angular/core/testing:  undefined ()
    @angular/forms: ^11.2.3 => 11.2.3
    @angular/language-service: ~11.2.3 => 11.2.3
    @angular/platform-browser: ^11.2.3 => 11.2.3
    @angular/platform-browser-dynamic: ^11.2.3 => 11.2.3
    @angular/platform-browser-dynamic/testing:  undefined ()
    @angular/platform-browser/animations:  undefined ()
    @angular/platform-browser/testing:  undefined ()
    @angular/router: ^11.2.3 => 11.2.3
    @angular/router/testing:  undefined ()
    @angular/router/upgrade:  undefined ()
    @ionic-native/clipboard: ^5.33.1 => 5.33.1
    @ionic-native/core: 5.33.0 => 5.33.0
    @ionic-native/fingerprint-aio: ^5.33.1 => 5.33.1
    @ionic-native/screen-orientation: ^5.32.1 => 5.33.1
    @ionic-native/splash-screen: 5.33.0 => 5.33.0
    @ionic-native/status-bar: 5.33.0 => 5.33.0
    @ionic/angular: 5.6.7 => 5.6.7
    @ionic/angular-toolkit: ^3.1.1 => 3.1.1
    @ionic/storage: ^2.3.1 => 2.3.1
    @ngx-translate/core: ^13.0.0 => 13.0.0
    @ngx-translate/http-loader: ^6.0.0 => 6.0.0
    @swimlane/ngx-charts: ^18.0.1 => 18.0.1
    @types/jasmine: ~3.7.4 => 3.7.7
    @types/jasminewd2: ~2.0.9 => 2.0.9
    @types/node: ^15.0.3 => 15.12.5
    aws-amplify: ^4.1.2 => 4.1.2
    axios: ^0.21.1 => 0.21.1
    codelyzer: ^6.0.2 => 6.0.2
    cordova-android: ^9.1.0 => 9.1.0
    cordova-clipboard: ^1.3.0 => 1.3.0
    cordova-ios: ^6.2.0 => 6.2.0
    cordova-plugin-device: 2.0.3 => 2.0.3
    cordova-plugin-device-tests:  2.0.3
    cordova-plugin-fingerprint-aio: ^4.0.2 => 4.0.2
    cordova-plugin-ionic: ^5.4.7 => 5.4.7 ()
    cordova-plugin-ionic-keyboard: ^2.2.0 => 2.2.0
    cordova-plugin-ionic-webview: ^5.0.0 => 5.0.0
    cordova-plugin-splashscreen: 6.0.0 => 6.0.0
    cordova-plugin-statusbar: 2.4.3 => 2.4.3
    cordova-plugin-statusbar-tests:  2.4.3
    cordova-plugin-whitelist: 1.3.4 => 1.3.4
    cordova-plugin-whitelist-tests:  1.3.4
    example-typescript:  1.0.0
    jasmine-core: ~3.7.1 => 3.7.1 (2.8.0)
    jasmine-spec-reporter: ~7.0.0 => 7.0.0
    karma: ~6.3.2 => 6.3.4
    karma-chrome-launcher: ~3.1.0 => 3.1.0
    karma-coverage-istanbul-reporter: ~3.0.3 => 3.0.3
    karma-jasmine: ~4.0.1 => 4.0.1
    karma-jasmine-html-reporter: ^1.6.0 => 1.6.0
    lib:  0.0.1
    line-reader: ^0.4.0 => 0.4.0
    ngx-autosize: ^1.8.4 => 1.8.4
    ngx-logger: ^4.2.2 => 4.2.2
    ngx-logger/testing:  undefined ()
    ngx-order-pipe: ^2.1.1 => 2.1.1
    ngx-webstorage-service: ^4.1.0 => 4.1.0
    node-example:  1.0.0
    protractor: ~7.0.0 => 7.0.0
    protractor-example:  1.0.0
    rxjs: ^7.0.1 => 7.1.0 (6.6.3, 6.6.7)
    rxjs/ajax:  undefined ()
    rxjs/fetch:  undefined ()
    rxjs/internal-compatibility:  undefined ()
    rxjs/operators:  undefined ()
    rxjs/testing:  undefined ()
    rxjs/webSocket:  undefined ()
    sha.js: ^2.4.11 => 2.4.11
    ts-node: ~9.1.1 => 9.1.1
    tslib: 2.2.0 => 2.2.0 (1.14.1, 2.1.0)
    tslint: ~6.1.0 => 6.1.3
    typescript: ^4.1.6 => 4.1.6 (4.1.3, 3.9.9)
    typescript-example:  1.0.0
    uuid: ^8.3.2 => 8.3.2 (3.4.0, 3.3.2, 7.0.3)
    zone-mix:  undefined ()
    zone-node:  undefined ()
    zone-testing:  undefined ()
    zone.js: ^0.11.4 => 0.11.4 (0.10.3)
    zone.js/async-test:  undefined ()
    zone.js/async-test.min:  undefined ()
    zone.js/fake-async-test:  undefined ()
    zone.js/fake-async-test.min:  undefined ()
    zone.js/jasmine-patch:  undefined ()
    zone.js/jasmine-patch.min:  undefined ()
    zone.js/long-stack-trace-zone:  undefined ()
    zone.js/long-stack-trace-zone.min:  undefined ()
    zone.js/mocha-patch:  undefined ()
    zone.js/mocha-patch.min:  undefined ()
    zone.js/proxy:  undefined ()
    zone.js/proxy.min:  undefined ()
    zone.js/sync-test:  undefined ()
    zone.js/sync-test.min:  undefined ()
    zone.js/task-tracking:  undefined ()
    zone.js/task-tracking.min:  undefined ()
    zone.js/webapis-media-query:  undefined ()
    zone.js/webapis-media-query.min:  undefined ()
    zone.js/webapis-notification:  undefined ()
    zone.js/webapis-notification.min:  undefined ()
    zone.js/webapis-rtc-peer-connection:  undefined ()
    zone.js/webapis-rtc-peer-connection.min:  undefined ()
    zone.js/webapis-shadydom:  undefined ()
    zone.js/webapis-shadydom.min:  undefined ()
    zone.js/wtf:  undefined ()
    zone.js/wtf.min:  undefined ()
    zone.js/zone-bluebird:  undefined ()
    zone.js/zone-bluebird.min:  undefined ()
    zone.js/zone-error:  undefined ()
    zone.js/zone-error.min:  undefined ()
    zone.js/zone-legacy:  undefined ()
    zone.js/zone-legacy.min:  undefined ()
    zone.js/zone-patch-canvas:  undefined ()
    zone.js/zone-patch-canvas.min:  undefined ()
    zone.js/zone-patch-cordova:  undefined ()
    zone.js/zone-patch-cordova.min:  undefined ()
    zone.js/zone-patch-electron:  undefined ()
    zone.js/zone-patch-electron.min:  undefined ()
    zone.js/zone-patch-fetch:  undefined ()
    zone.js/zone-patch-fetch.min:  undefined ()
    zone.js/zone-patch-jsonp:  undefined ()
    zone.js/zone-patch-jsonp.min:  undefined ()
    zone.js/zone-patch-message-port:  undefined ()
    zone.js/zone-patch-message-port.min:  undefined ()
    zone.js/zone-patch-promise-test:  undefined ()
    zone.js/zone-patch-promise-test.min:  undefined ()
    zone.js/zone-patch-resize-observer:  undefined ()
    zone.js/zone-patch-resize-observer.min:  undefined ()
    zone.js/zone-patch-rxjs:  undefined ()
    zone.js/zone-patch-rxjs-fake-async:  undefined ()
    zone.js/zone-patch-rxjs-fake-async.min:  undefined ()
    zone.js/zone-patch-rxjs.min:  undefined ()
    zone.js/zone-patch-socket-io:  undefined ()
    zone.js/zone-patch-socket-io.min:  undefined ()
    zone.js/zone-patch-user-media:  undefined ()
    zone.js/zone-patch-user-media.min:  undefined ()
  npmGlobalPackages:
    @angular/cli: 12.0.5
    @ionic/cli: 6.12.3
    aws-sdk: 2.740.0
    bower: 1.8.12
    copyfiles: 2.4.1
    cordova-res: 0.15.2
    cordova: 10.0.0
    env-cmd: 10.1.0
    firebase-tools: 9.2.1
    git-credential-env: 1.0.0
    gulp: 4.0.2
    http-server: 0.12.3
    native-run: 1.2.1
    node-gyp: 7.1.2
    node-properties-parser: 0.0.2
    nodemon: 2.0.7
    npm-check-updates: 11.1.10
    npm: 6.14.11
    react-devtools: 4.10.0
    react-native-cli: 2.0.1
    rimraf: 3.0.2
    sails: 1.4.0
    serverless: 2.39.1
    typescript: 4.1.2
    webpack: 5.24.2
    yarn: 1.22.10

Describe the bug

When a user has exceeded their password attempts or entering wrong password the error code is: 'NotAuthorizedException'.

Expected behavior

Maybe provide new error code for this case. PasswordAttemptsExceeded to make it easier to handle this in the client.

Reproduction steps

Try to authenticate user 5-10 times with incorrect password.

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

image (5)

Metadata

Metadata

Assignees

No one assigned

    Labels

    AuthRelated to Auth components/categoryCognitoRelated to cognito issuesfeature-requestRequest a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions