aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.44k stars 2.13k forks source link

OAuthScope type definition contains "email" twice #14016

Open steinsag opened 2 hours ago

steinsag commented 2 hours ago

Before opening, please confirm:

JavaScript Framework

Not applicable

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

Other

Environment information

``` # Put output below this line System: OS: Linux 6.11 CentOS Stream 9 CPU: (32) x64 AMD Ryzen Container: Yes Shell: 5.8 - /bin/zsh Binaries: Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node npm: 10.8.2 - ~/.nvm/versions/node/v20.17.0/bin/npm Browsers: Chrome: 131.0.6778.69 npmPackages: ... aws-amplify: ^6.8.2 => 6.8.2 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/enable-oauth-listener: undefined () aws-amplify/auth/server: undefined () aws-amplify/data: undefined () aws-amplify/data/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 () ```

Describe the bug

https://github.com/aws-amplify/amplify-js/blob/main/packages/core/src/singleton/Auth/types.ts#L197 contains twice email, which is most probably wrong:

export type OAuthScope =
    | 'email'
    | 'openid'
    | 'phone'
    | 'email'     <<<<<<<----------- second time
    | 'profile'
    | 'aws.cognito.signin.user.admin'
    | CustomScope;

Expected behavior

type definition should be clean

Reproduction steps

none

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

No response

cwomack commented 2 hours ago

@steinsag, thanks for opening this issue! Looks like we indeed have the type duplicated here. Appreciate the links directly to it and will review with the team to get this fixed.

steinsag commented 2 hours ago

@cwomack added a small PR, but feel free to get this changed by the experts :-)

cwomack commented 2 hours ago

Excellent! Thanks for taking the time to do that, @steinsag.