@aws-amplify/core 6.0.1-preview-testing.64b45b1.0 → 6.0.1-preview-testing.034e780.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
- package/lib/AwsClients/Pinpoint/putEvents.d.ts +1 -1
- package/lib/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
- package/lib/Platform/version.d.ts +1 -1
- package/lib/Platform/version.js +1 -1
- package/lib/clients/types/aws.d.ts +1 -1
- package/lib/index.d.ts +0 -1
- package/lib/index.js +1 -3
- package/lib/libraryUtils.d.ts +2 -0
- package/lib/libraryUtils.js +4 -2
- package/lib/singleton/Amplify.d.ts +2 -2
- package/lib/singleton/Amplify.js +9 -1
- package/lib/singleton/Auth/index.d.ts +2 -1
- package/lib/singleton/Auth/index.js +22 -12
- package/lib/singleton/Auth/utils/index.js +3 -3
- package/lib/singleton/types.d.ts +6 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/AwsClients/Pinpoint/getInAppMessages.d.ts +1 -1
- package/lib-esm/AwsClients/Pinpoint/putEvents.d.ts +1 -1
- package/lib-esm/AwsClients/Pinpoint/updateEndpoint.d.ts +1 -1
- package/lib-esm/Platform/version.d.ts +1 -1
- package/lib-esm/Platform/version.js +1 -1
- package/lib-esm/clients/types/aws.d.ts +1 -1
- package/lib-esm/index.d.ts +0 -1
- package/lib-esm/index.js +0 -1
- package/lib-esm/libraryUtils.d.ts +2 -0
- package/lib-esm/libraryUtils.js +1 -0
- package/lib-esm/singleton/Amplify.d.ts +2 -2
- package/lib-esm/singleton/Amplify.js +9 -1
- package/lib-esm/singleton/Auth/index.d.ts +2 -1
- package/lib-esm/singleton/Auth/index.js +22 -12
- package/lib-esm/singleton/Auth/utils/index.js +3 -3
- package/lib-esm/singleton/types.d.ts +6 -0
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/Platform/version.ts +1 -1
- package/src/clients/types/aws.ts +4 -1
- package/src/index.ts +0 -2
- package/src/libraryUtils.ts +2 -1
- package/src/singleton/Amplify.ts +12 -3
- package/src/singleton/Auth/index.ts +9 -2
- package/src/singleton/Auth/utils/index.ts +3 -3
- package/src/singleton/types.ts +7 -0
|
@@ -52,8 +52,7 @@ export class AuthClass {
|
|
|
52
52
|
let userSub: string | undefined;
|
|
53
53
|
|
|
54
54
|
// Get tokens will throw if session cannot be refreshed (network or service error) or return null if not available
|
|
55
|
-
tokens =
|
|
56
|
-
(await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined;
|
|
55
|
+
tokens = await this.getTokens(options);
|
|
57
56
|
|
|
58
57
|
if (tokens) {
|
|
59
58
|
userSub = tokens.accessToken?.payload?.sub;
|
|
@@ -93,4 +92,12 @@ export class AuthClass {
|
|
|
93
92
|
return await this.authOptions.credentialsProvider.clearCredentialsAndIdentityId();
|
|
94
93
|
}
|
|
95
94
|
}
|
|
95
|
+
|
|
96
|
+
async getTokens(
|
|
97
|
+
options: FetchAuthSessionOptions
|
|
98
|
+
): Promise<AuthTokens | undefined> {
|
|
99
|
+
return (
|
|
100
|
+
(await this.authOptions?.tokenProvider?.getTokens(options)) ?? undefined
|
|
101
|
+
);
|
|
102
|
+
}
|
|
96
103
|
}
|
|
@@ -63,10 +63,10 @@ export function assertIdentityPooIdConfig(
|
|
|
63
63
|
): asserts cognitoConfig is CognitoIdentityPoolConfig {
|
|
64
64
|
const validConfig = !!cognitoConfig?.identityPoolId;
|
|
65
65
|
return asserts(validConfig, {
|
|
66
|
-
name: '
|
|
67
|
-
message: '
|
|
66
|
+
name: 'InvalidIdentityPoolIdException',
|
|
67
|
+
message: 'Invalid identity pool id provided.',
|
|
68
68
|
recoverySuggestion:
|
|
69
|
-
'Make sure
|
|
69
|
+
'Make sure a valid identityPoolId is given in the config.',
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
package/src/singleton/types.ts
CHANGED
|
@@ -17,6 +17,13 @@ import {
|
|
|
17
17
|
StorageConfig,
|
|
18
18
|
} from './Storage/types';
|
|
19
19
|
|
|
20
|
+
export type LegacyConfig = {
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated The field should not be used.
|
|
23
|
+
*/
|
|
24
|
+
aws_project_region?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
20
27
|
export type ResourcesConfig = {
|
|
21
28
|
// API?: {};
|
|
22
29
|
Analytics?: AnalyticsConfig;
|