Showing 3 of 50 files from the diff.
Other files ignored by Codecov

@@ -1,2 +1,2 @@
Loading
1 1
// generated by genversion
2 -
export const version = '3.5.3';
2 +
export const version = '3.5.4';

@@ -33,8 +33,8 @@
Loading
33 33
	private _identityId;
34 34
	private _nextCredentialsRefresh: Number;
35 35
36 -
	// `Amplify.Auth` will either be `Auth` or `null` depending on if Auth was imported
37 -
	Auth = Amplify.Auth;
36 +
	// Allow `Auth` to be injected for SSR, but Auth isn't a required dependency for Credentials
37 +
	Auth = undefined;
38 38
39 39
	constructor(config) {
40 40
		this.configure(config);
@@ -105,8 +105,11 @@
Loading
105 105
		logger.debug('need to get a new credential or refresh the existing one');
106 106
107 107
		// Some use-cases don't require Auth for signing in, but use Credentials for guest users (e.g. Analytics)
108 -
		if (this.Auth && typeof this.Auth.currentUserCredentials === 'function') {
109 -
			return this.Auth.currentUserCredentials();
108 +
		// Prefer locally scoped `Auth`, but fallback to registered `Amplify.Auth` global otherwise.
109 +
		const { Auth = Amplify.Auth } = this;
110 +
111 +
		if (Auth && typeof Auth.currentUserCredentials === 'function') {
112 +
			return Auth.currentUserCredentials();
110 113
		} else {
111 114
			return Promise.reject('No Auth module registered in Amplify');
112 115
		}

@@ -103,6 +103,7 @@
Loading
103 103
	 */
104 104
	constructor(config: AuthOptions) {
105 105
		this.configure(config);
106 +
		this.currentCredentials = this.currentCredentials.bind(this);
106 107
		this.currentUserCredentials = this.currentUserCredentials.bind(this);
107 108
108 109
		Hub.listen('auth', ({ payload }) => {
@@ -1347,7 +1348,6 @@
Loading
1347 1348
	 * @return - A promise resolves to be current user's credentials
1348 1349
	 */
1349 1350
	public async currentUserCredentials(): Promise<ICredentials> {
1350 -
		const that = this;
1351 1351
		logger.debug('Getting current user credentials');
1352 1352
1353 1353
		try {
Files Coverage
packages 73.35%
Project Totals (212 files) 73.35%
1
codecov:
2
  notify:
3
    after_n_builds: 1
4

5
coverage:
6
  status:
7
    project: off
8
    patch: off
9
    changes:
10
      default:
11
        target: 82%
12
        if_not_found: success
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading