1 | import GoogleAuthData from './GoogleAuthData';
|
2 | class 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 | }
|
36 | export default GoogleIdentity;
|
37 |
|
\ | No newline at end of file |