MCPcopy Create free account
hub / github.com/CodetrixStudio/CapacitorGoogleAuth / getUserFrom

Method getUserFrom

src/web.ts:135–154  ·  view source on GitHub ↗
(googleUser: gapi.auth2.GoogleUser)

Source from the content-addressed store, hash-verified

133 }
134
135 private getUserFrom(googleUser: gapi.auth2.GoogleUser) {
136 const user = {} as User;
137 const profile = googleUser.getBasicProfile();
138
139 user.email = profile.getEmail();
140 user.familyName = profile.getFamilyName();
141 user.givenName = profile.getGivenName();
142 user.id = profile.getId();
143 user.imageUrl = profile.getImageUrl();
144 user.name = profile.getName();
145
146 const authResponse = googleUser.getAuthResponse(true);
147 user.authentication = {
148 accessToken: authResponse.access_token,
149 idToken: authResponse.id_token,
150 refreshToken: '',
151 };
152
153 return user;
154 }
155}

Callers 2

signInMethod · 0.95
addUserChangeListenerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected