UNPKG

1.22 kBJavaScriptView Raw
1import GoogleAuthData from './GoogleAuthData';
2class GoogleIdentity extends GoogleAuthData {
3 constructor(options) {
4 super(options);
5 const { uid, email, displayName, photoURL, firstName, lastName } = options;
6 this.uid = uid;
7 this.email = email;
8 this.displayName = displayName;
9 this.photoURL = photoURL;
10 this.firstName = firstName;
11 this.lastName = lastName;
12 }
13 equals(other) {
14 if (!super.equals(other) || !(other instanceof GoogleIdentity)) {
15 return false;
16 }
17 return (this.displayName === other.displayName &&
18 this.photoURL === other.photoURL &&
19 this.uid === other.uid &&
20 this.email === other.email &&
21 this.firstName === other.firstName &&
22 this.lastName === other.lastName);
23 }
24 toJSON() {
25 return {
26 ...super.toJSON(),
27 uid: this.uid,
28 email: this.email,
29 displayName: this.displayName,
30 photoURL: this.photoURL,
31 firstName: this.firstName,
32 lastName: this.lastName,
33 };
34 }
35}
36export default GoogleIdentity;
37//# sourceMappingURL=GoogleIdentity.js.map
\No newline at end of file