Skip to content

Commit

Permalink
[AUTOMATED]: Prettier Code Styling
Browse files Browse the repository at this point in the history
  • Loading branch information
avolkovi committed Apr 24, 2020
1 parent fb25508 commit 95ef116
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
17 changes: 8 additions & 9 deletions packages-exp/auth-exp/src/core/providers/auth_credential_impl.ts
Expand Up @@ -15,7 +15,6 @@
* limitations under the License.
*/


import { AuthCredential } from '../../model/auth_credential';
import { ProviderId, SignInMethod } from '.';
import { IdTokenResponse } from '../../model/id_token';
Expand All @@ -25,22 +24,22 @@ import { Auth } from '../../model/auth';
export class AuthCredentialImpl implements AuthCredential {
constructor(
readonly providerId: ProviderId,
readonly signInMethod: SignInMethod,
readonly signInMethod: SignInMethod
) {}

toJSON(): object {
throw new Error('Method not implemented.');
};
}

_getIdTokenResponse(_auth: Auth): Promise<PhoneOrOauthTokenResponse> {
throw new Error('Method not implemented.');
};;
}

_linkToIdToken(_auth: Auth, _idToken: string): Promise<IdTokenResponse> {
throw new Error('Method not implemented.');
};;
}

_matchIdTokenWithUid(_auth: Auth, _uid: string): Promise<IdTokenResponse> {
throw new Error('Method not implemented.');
};;
}
}
13 changes: 9 additions & 4 deletions packages-exp/auth-exp/src/core/user/user_credential_impl.test.ts
Expand Up @@ -28,7 +28,7 @@ import { UserCredentialImpl } from './user_credential_impl';
use(chaiAsPromised);

describe('core/user/user_credential_impl', () => {
describe("fromIdTokenResponse", () => {
describe('fromIdTokenResponse', () => {
const idTokenResponse: IdTokenResponse = {
idToken: 'my-id-token',
refreshToken: 'my-refresh-token',
Expand All @@ -43,10 +43,15 @@ describe('core/user/user_credential_impl', () => {
);

it('should initialize a UserCredential', async () => {
const userCredential = await UserCredentialImpl._fromIdTokenResponse(mockAuth, credential, OperationType.SIGN_IN, idTokenResponse);
const userCredential = await UserCredentialImpl._fromIdTokenResponse(
mockAuth,
credential,
OperationType.SIGN_IN,
idTokenResponse
);
expect(userCredential.credential).to.eq(credential);
expect(userCredential.operationType).to.eq(OperationType.SIGN_IN);
expect(userCredential.user.uid).to.eq('my-uid');
});
});
});
});
});
5 changes: 2 additions & 3 deletions packages-exp/auth-exp/src/core/user/user_credential_impl.ts
Expand Up @@ -22,13 +22,12 @@ import { User } from '../../model/user';
import { OperationType, UserCredential } from '../../model/user_credential';
import { UserImpl } from './user_impl';


export class UserCredentialImpl implements UserCredential {
constructor(
public readonly user: User,
public readonly credential: AuthCredential | null,
public readonly operationType: OperationType
) { }
) {}

static async _fromIdTokenResponse(
auth: Auth,
Expand All @@ -44,4 +43,4 @@ export class UserCredentialImpl implements UserCredential {
// updateAdditionalUserInfoFromIdTokenResponse(userCred, idTokenResponse);
return userCred;
}
}
}
2 changes: 1 addition & 1 deletion packages-exp/auth-exp/src/model/auth_credential.d.ts
Expand Up @@ -33,4 +33,4 @@ export interface OAuthCredential extends AuthCredential {
readonly idToken?: string;
readonly accessToken?: string;
readonly secret?: string;
}
}
6 changes: 3 additions & 3 deletions packages-exp/auth-exp/src/model/user_credential.ts
Expand Up @@ -25,7 +25,7 @@ export enum OperationType {
}

export interface UserCredential {
user: User,
credential: AuthCredential | null,
user: User;
credential: AuthCredential | null;
operationType: OperationType;
}
}

0 comments on commit 95ef116

Please sign in to comment.