amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

Unable to find UserAlreadyAuthenticatedException for importing

Open brianreinhold opened this issue 1 year ago • 10 comments

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.19045
    CPU: (4) x64 Intel(R) Core(TM) i3-6320 CPU @ 3.90GHz
    Memory: 5.66 GB / 15.89 GB
  Binaries:
    Node: 18.18.2 - ~\AppData\Local\nvs\node\18.18.2\x64\node.EXE
    npm: 9.8.1 - ~\AppData\Local\nvs\node\18.18.2\x64\npm.CMD
  Browsers:
    Chrome: 120.0.6099.110
    Edge: Chromium (120.0.2210.77)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    @angular-devkit/build-angular: ^16.2.8 => 16.2.10
    @angular-devkit/core: ^16.2.8 => 16.2.10
    @angular-eslint/builder: 16.3.1 => 16.3.1
    @angular-eslint/eslint-plugin: 16.3.1 => 16.3.1
    @angular-eslint/eslint-plugin-template: 16.3.1 => 16.3.1
    @angular-eslint/schematics: 16.3.1 => 16.3.1
    @angular-eslint/template-parser: 16.3.1 => 16.3.1
    @angular/animations: ^16.2.11 => 16.2.12
    @angular/cdk: ^16.2.10 => 16.2.12
    @angular/cli: ^16.2.8 => 16.2.10
    @angular/common: ^16.2.11 => 16.2.12
    @angular/compiler: ^16.2.11 => 16.2.12
    @angular/compiler-cli: ^16.2.11 => 16.2.12
    @angular/core: ^16.2.11 => 16.2.12
    @angular/forms: ^16.1.7 => 16.2.12
    @angular/material: ^16.2.10 => 16.2.12
    @angular/platform-browser: ^16.2.11 => 16.2.12
    @angular/platform-browser-dynamic: ^16.2.11 => 16.2.12
    @angular/router: ^16.2.11 => 16.2.12
    @fhir-typescript/r4b-core: ^0.0.12-beta.18 => 0.0.12-beta.18
    @types/crypto-js: ^4.1.3 => 4.2.1
    @types/jasmine: ^4.6.1 => 4.6.4
    @types/node: ^18.18.2 => 18.19.3
    @types/qrcode: ^1.5.4 => 1.5.5
    @typescript-eslint/eslint-plugin: 5.62.0 => 5.62.0
    @typescript-eslint/parser: 5.62.0 => 5.62.0
    angularx-qrcode: ^16.0.2 => 16.0.2
    aws-amplify: ^6.0.7 => 6.0.7
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    crypto-js: ^4.2.0 => 4.2.0
    eslint: ^8.51.0 => 8.55.0
    jasmine-core: ^4.6.0 => 4.6.0
    karma: ^6.4.1 => 6.4.2
    karma-chrome-launcher: 3.1.1 => 3.1.1
    karma-coverage: 2.2.0 => 2.2.0
    karma-coverage-coffee-example:  1.0.0
    karma-jasmine: 5.1.0 => 5.1.0
    karma-jasmine-html-reporter: 2.0.0 => 2.0.0
    lz-string: ^1.5.0 => 1.5.0
    ngx-toastr: ^16.2.0 => 16.2.0
    rxjs: ^7.8.1 => 7.8.1
    rxjs/ajax:  undefined ()
    rxjs/fetch:  undefined ()
    rxjs/operators:  undefined ()
    rxjs/testing:  undefined ()
    rxjs/webSocket:  undefined ()
    tslib: ^2.6.2 => 2.6.2 (2.6.1, 1.14.1)
    typescript: ^4.9.5 => 4.9.5
    zone.js: ^0.13.3 => 0.13.3
  npmGlobalPackages:
    corepack: 0.19.0
    npm: 9.8.1

Describe the bug

Doing a signIn() operation aws-amplify throws a UserAlreadyAuthenticatedException. The problem is not the exception but I cannot find any documentation on it so I cannot even import it in my attempt to handle it. I guessed my way to this:

console.log(err);
        if (err instanceof UserAlreadyAuthenticatedException)

however UserAlreadyAuthenticatedException is not recognized. I need to import it. But so far I have not been able find where to import it from.

Here is where the documentation fails. This is not the only object that I have found very difficult to find where it is declared. This one has been so difficult I have still not found it.

Expected behavior

The documentation would provide the necessary imports so one can handle errors.

Reproduction steps

Search the documentation.

Code Snippet

Code is not relevant, Need to import UserAlreadyAuthenticatedException

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

No response

brianreinhold avatar Dec 19 '23 17:12 brianreinhold