capacitor-native-google-one-tap-signin 5.1.2 → 5.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/android/src/main/java/com/proventask/capacitor/GoogleOneTapAuth/GoogleOneTapAuth.java +34 -26
- package/android/src/main/java/com/proventask/capacitor/GoogleOneTapAuth/SignInResult.java +16 -0
- package/dist/docs.json +8 -1
- package/dist/esm/GoogleOneTapAuth.js +11 -5
- package/dist/esm/GoogleOneTapAuth.js.map +1 -1
- package/dist/esm/definitions.d.ts +6 -2
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.js +2 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +13 -12
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +14 -13
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/Plugin.swift +2 -2
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -79,6 +79,10 @@ console.log(signInResultSuccess);
|
|
|
79
79
|
// See the demo folder for an example application.
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
+
# Run the demo app
|
|
83
|
+
This repository contains a demo app in the `demo` folder.
|
|
84
|
+
|
|
85
|
+
|
|
82
86
|
# Notes about testing with an emulator
|
|
83
87
|
|
|
84
88
|
To test it using an emulator, you need to create an emulator with android play services and API version 24 or higher. See [my stackoverflow answer](https://stackoverflow.com/questions/71325279/missing-featurename-auth-api-credentials-begin-sign-in-version-6/75285717#75285717). For older API levels like 24, you may need to update Chrome after creating the emulator because the plugin targets JavaScript es2017.
|
|
@@ -86,9 +90,6 @@ To test it using an emulator, you need to create an emulator with android play s
|
|
|
86
90
|
# Supported platforms
|
|
87
91
|
Android, iOS, Web.
|
|
88
92
|
|
|
89
|
-
# Demos
|
|
90
|
-
See the `demo` folder.
|
|
91
|
-
|
|
92
93
|
# Detailed description of different use cases
|
|
93
94
|
|
|
94
95
|
See https://developers.google.com/identity/gsi/web/guides/features
|
|
@@ -166,7 +167,7 @@ getNonce(): string;
|
|
|
166
167
|
```
|
|
167
168
|
|
|
168
169
|
# Design decisions
|
|
169
|
-
Promises will not be rejected for anticipated unsuccessful control flow. For example, if the one tap auto-login does not succeed
|
|
170
|
+
Promises will not be rejected for anticipated unsuccessful control flow. For example, if the one tap auto-login does not succeed because there is no session then this is not exceptional but expected in many cases. Rejecting the promise would mean the caller would have to catch an exception when calling `await xy` and then run follow-up code in the catch block. However when creating the demo app it was also evident that it is useful to have a promise that only resolves when authentication succeeds. Therefore the `tryAutoOrOneTapSignIn` method returns a Promise object that contains 3 properties with promises. One resolves only when authentication succeeds, the second on error and the third on success or error.
|
|
170
171
|
|
|
171
172
|
Instead of creating one signIn method with many parameters that are only used in some cases (=unclear dependencies), there are two methods with different parameters and different return types.
|
|
172
173
|
|
package/android/src/main/java/com/proventask/capacitor/GoogleOneTapAuth/GoogleOneTapAuth.java
CHANGED
|
@@ -29,9 +29,6 @@ import com.google.android.gms.common.GoogleApiAvailability;
|
|
|
29
29
|
import com.google.android.gms.common.api.ApiException;
|
|
30
30
|
import com.google.android.gms.tasks.Task;
|
|
31
31
|
|
|
32
|
-
import org.json.JSONException;
|
|
33
|
-
import org.json.JSONObject;
|
|
34
|
-
|
|
35
32
|
import java.util.concurrent.CompletableFuture;
|
|
36
33
|
import java.util.concurrent.ExecutionException;
|
|
37
34
|
import java.util.concurrent.Future;
|
|
@@ -39,13 +36,14 @@ import java.util.concurrent.Future;
|
|
|
39
36
|
@CapacitorPlugin()
|
|
40
37
|
public class GoogleOneTapAuth extends Plugin {
|
|
41
38
|
private static final String TAG = "GoogleOneTapAuth Plugin";
|
|
39
|
+
private static final String ReasonCodeSignInCancelled = "SIGN_IN_CANCELLED";
|
|
42
40
|
private String clientId;
|
|
43
41
|
private String nonce;
|
|
44
42
|
private SignInClient oneTapClient;
|
|
45
43
|
private GoogleSignInClient googleSignInClient;
|
|
46
44
|
private ActivityResultLauncher<IntentSenderRequest> googleOneTapSignInActivityResultHandlerIntentSenderRequest;
|
|
47
|
-
private CompletableFuture<
|
|
48
|
-
private CompletableFuture<
|
|
45
|
+
private CompletableFuture<SignInResult> oneTapSignInFuture;
|
|
46
|
+
private CompletableFuture<SignInResult> googleSignInFuture;
|
|
49
47
|
|
|
50
48
|
@Override
|
|
51
49
|
public void load() {
|
|
@@ -86,8 +84,9 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
86
84
|
oneTapSignInFuture.complete(createErrorResponse(null, e.toString()));
|
|
87
85
|
}
|
|
88
86
|
} else {
|
|
87
|
+
var reasonCode = resultCode == Activity.RESULT_CANCELED ? ReasonCodeSignInCancelled : null;
|
|
89
88
|
var resultCodeString = ActivityResult.resultCodeToString(resultCode);
|
|
90
|
-
oneTapSignInFuture.complete(createErrorResponse(
|
|
89
|
+
oneTapSignInFuture.complete(createErrorResponse(reasonCode, resultCodeString));
|
|
91
90
|
}
|
|
92
91
|
});
|
|
93
92
|
}
|
|
@@ -96,13 +95,13 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
96
95
|
public void tryAutoOrOneTapSignIn(PluginCall call) {
|
|
97
96
|
try {
|
|
98
97
|
var signInResult = beginSignIn(true).get();
|
|
99
|
-
if (
|
|
98
|
+
if (signInResult.idToken == null && signInResult.noSuccessReasonCode != ReasonCodeSignInCancelled) {
|
|
100
99
|
signInResult = beginSignIn(false).get();
|
|
101
100
|
}
|
|
102
|
-
if (
|
|
101
|
+
if (signInResult.idToken == null && signInResult.noSuccessReasonCode != ReasonCodeSignInCancelled) {
|
|
103
102
|
signInResult = googleSilentSignIn(call).get();
|
|
104
103
|
}
|
|
105
|
-
call.resolve(
|
|
104
|
+
call.resolve(convertToJsonResult(signInResult));
|
|
106
105
|
} catch (ExecutionException | InterruptedException e) {
|
|
107
106
|
call.reject(e.toString());
|
|
108
107
|
}
|
|
@@ -113,20 +112,32 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
113
112
|
public void triggerGoogleSignIn(PluginCall call) {
|
|
114
113
|
try {
|
|
115
114
|
var signInResult = googleSignIn(call).get();
|
|
116
|
-
call.resolve(signInResult);
|
|
115
|
+
call.resolve(convertToJsonResult(signInResult));
|
|
117
116
|
} catch (ExecutionException | InterruptedException e) {
|
|
118
117
|
call.reject(e.toString());
|
|
119
118
|
}
|
|
120
119
|
}
|
|
121
120
|
|
|
122
|
-
private JSObject
|
|
121
|
+
private JSObject convertToJsonResult(SignInResult signInResult) {
|
|
123
122
|
var result = new JSObject();
|
|
124
|
-
|
|
125
|
-
result.put("
|
|
123
|
+
boolean isSuccess = signInResult.idToken != null;
|
|
124
|
+
result.put("isSuccess", isSuccess);
|
|
125
|
+
|
|
126
|
+
if (isSuccess) {
|
|
127
|
+
var successObj = new JSObject();
|
|
128
|
+
successObj.put("idToken", signInResult.idToken);
|
|
129
|
+
result.put("success", successObj);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
var errorObj = new JSObject();
|
|
133
|
+
errorObj.put("noSuccessReasonCode", signInResult.noSuccessReasonCode);
|
|
134
|
+
errorObj.put("noSuccessAdditionalInfo", signInResult.noSuccessAdditionalInfo);
|
|
135
|
+
result.put("error", errorObj);
|
|
136
|
+
}
|
|
126
137
|
return result;
|
|
127
138
|
}
|
|
128
139
|
|
|
129
|
-
private Future<
|
|
140
|
+
private Future<SignInResult> beginSignIn(boolean filterByAuthorizedAccounts) {
|
|
130
141
|
var context = this.getContext();
|
|
131
142
|
var beginSignInRequest = createBeginSignInRequest(filterByAuthorizedAccounts);
|
|
132
143
|
oneTapSignInFuture = new CompletableFuture<>();
|
|
@@ -177,17 +188,12 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
177
188
|
.build();
|
|
178
189
|
}
|
|
179
190
|
|
|
180
|
-
private
|
|
181
|
-
|
|
182
|
-
result.put("noSuccessReasonCode", reasonCode);
|
|
183
|
-
result.put("noSuccessAdditionalInfo", noSuccessAdditionalInfo);
|
|
184
|
-
return result;
|
|
191
|
+
private SignInResult createErrorResponse(String reasonCode, String noSuccessAdditionalInfo) {
|
|
192
|
+
return new SignInResult(reasonCode, noSuccessAdditionalInfo);
|
|
185
193
|
}
|
|
186
194
|
|
|
187
|
-
private
|
|
188
|
-
|
|
189
|
-
result.put("idToken", idToken);
|
|
190
|
-
return result;
|
|
195
|
+
private SignInResult createSuccessResponse(String idToken) {
|
|
196
|
+
return new SignInResult(idToken);
|
|
191
197
|
}
|
|
192
198
|
|
|
193
199
|
private boolean isGooglePlayServicesAvailable(Context context) {
|
|
@@ -216,14 +222,14 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
216
222
|
return signOutResult;
|
|
217
223
|
}
|
|
218
224
|
|
|
219
|
-
private Future<
|
|
225
|
+
private Future<SignInResult> googleSilentSignIn(final PluginCall call) {
|
|
220
226
|
googleSignInFuture = new CompletableFuture<>();
|
|
221
227
|
googleSignInClient.silentSignIn()
|
|
222
228
|
.addOnCompleteListener(task -> handleGoogleSignInResult(call, task, "silentSignIn"));
|
|
223
229
|
return googleSignInFuture;
|
|
224
230
|
}
|
|
225
231
|
|
|
226
|
-
private Future<
|
|
232
|
+
private Future<SignInResult> googleSignIn(final PluginCall call) {
|
|
227
233
|
googleSignInFuture = new CompletableFuture<>();
|
|
228
234
|
var intent = googleSignInClient.getSignInIntent();
|
|
229
235
|
startActivityForResult(call, intent, "googleSignInResultIntentCallback");
|
|
@@ -248,7 +254,9 @@ public class GoogleOneTapAuth extends Plugin {
|
|
|
248
254
|
googleSignInFuture.complete(createSuccessResponse(account.getIdToken()));
|
|
249
255
|
} catch (ApiException e) {
|
|
250
256
|
int statusCode = e.getStatusCode();
|
|
251
|
-
var statusCodeString = GoogleSignInStatusCodes.
|
|
257
|
+
var statusCodeString = statusCode == GoogleSignInStatusCodes.SIGN_IN_CANCELLED
|
|
258
|
+
? ReasonCodeSignInCancelled
|
|
259
|
+
: GoogleSignInStatusCodes.getStatusCodeString(statusCode);
|
|
252
260
|
Log.i(TAG, triggerMethodName + " not successful, statusCodeString " + statusCodeString, e);
|
|
253
261
|
if (statusCode == GoogleSignInStatusCodes.SIGN_IN_REQUIRED
|
|
254
262
|
|| statusCode == GoogleSignInStatusCodes.SIGN_IN_CANCELLED) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
package com.proventask.capacitor.GoogleOneTapAuth;
|
|
2
|
+
|
|
3
|
+
public class SignInResult {
|
|
4
|
+
public String idToken;
|
|
5
|
+
public String noSuccessReasonCode;
|
|
6
|
+
public String noSuccessAdditionalInfo;
|
|
7
|
+
|
|
8
|
+
public SignInResult(String noSuccessReasonCode, String noSuccessAdditionalInfo) {
|
|
9
|
+
this.noSuccessReasonCode = noSuccessReasonCode;
|
|
10
|
+
this.noSuccessAdditionalInfo = noSuccessAdditionalInfo;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
public SignInResult(String idToken) {
|
|
14
|
+
this.idToken = idToken;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/dist/docs.json
CHANGED
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
{
|
|
226
226
|
"name": "noSuccessReasonCode",
|
|
227
227
|
"tags": [],
|
|
228
|
-
"docs": "A reason code as '
|
|
228
|
+
"docs": "A reason code as 'tap_outside'.\nFor the js library see google.PromptMomentNotification for possible values.\nFor android and iOS 'SIGN_IN_CANCELLED' are currently set.",
|
|
229
229
|
"complexTypes": [],
|
|
230
230
|
"type": "string | undefined"
|
|
231
231
|
},
|
|
@@ -310,6 +310,13 @@
|
|
|
310
310
|
"docs": "The Sign In With Google button UX flow. The default value is 'popup'.",
|
|
311
311
|
"complexTypes": [],
|
|
312
312
|
"type": "'popup' | 'redirect' | undefined"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "cancelOnTapOutside",
|
|
316
|
+
"tags": [],
|
|
317
|
+
"docs": "This field sets whether or not to cancel the One Tap request if a user clicks outside the prompt. The default value is true.",
|
|
318
|
+
"complexTypes": [],
|
|
319
|
+
"type": "boolean | undefined"
|
|
313
320
|
}
|
|
314
321
|
]
|
|
315
322
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Capacitor, registerPlugin } from '@capacitor/core';
|
|
2
2
|
import { assert, randomHexString } from './helpers';
|
|
3
3
|
import { GoogleOneTapAuthWeb } from './web';
|
|
4
|
-
import
|
|
4
|
+
import { jwtDecode } from "jwt-decode";
|
|
5
5
|
const GoogleOneTapAuthPlatform = registerPlugin('GoogleOneTapAuth', {
|
|
6
6
|
web: () => new GoogleOneTapAuthWeb(),
|
|
7
7
|
});
|
|
@@ -115,13 +115,19 @@ class GoogleOneTapAuth {
|
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
117
|
const onClickAction = async () => {
|
|
118
|
+
var _a;
|
|
118
119
|
try {
|
|
119
|
-
|
|
120
|
-
if (
|
|
121
|
-
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);
|
|
120
|
+
const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);
|
|
121
|
+
if (notEnrichedSuccessSignInResult.isSuccess) {
|
|
122
|
+
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success);
|
|
122
123
|
this.authenticatedUserId = enrichtedSuccessSignInResult.userId;
|
|
123
124
|
resolve(enrichtedSuccessSignInResult);
|
|
124
125
|
}
|
|
126
|
+
else {
|
|
127
|
+
if (((_a = notEnrichedSuccessSignInResult.noSuccess) === null || _a === void 0 ? void 0 : _a.noSuccessReasonCode) === 'SIGN_IN_CANCELLED') {
|
|
128
|
+
// console.log('User cancelled sign in. Waiting for next sign in attempt.');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
125
131
|
}
|
|
126
132
|
catch (e) {
|
|
127
133
|
reject(e);
|
|
@@ -146,7 +152,7 @@ class GoogleOneTapAuth {
|
|
|
146
152
|
return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });
|
|
147
153
|
}
|
|
148
154
|
enrichSuccessResultWithDecodedIdToken(successSignInResult) {
|
|
149
|
-
const decodedJwt =
|
|
155
|
+
const decodedJwt = jwtDecode(successSignInResult.idToken);
|
|
150
156
|
return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });
|
|
151
157
|
}
|
|
152
158
|
getSignInButtonHtml(gsiButtonConfiguration) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleOneTapAuth.js","sourceRoot":"","sources":["../../src/GoogleOneTapAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,UAAU,MAAM,YAAY,CAAC;AAGpC,MAAM,wBAAwB,GAAG,cAAc,CAAsB,kBAAkB,EAAE;IACvF,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE;CACrC,CAAC,CAAC;AAEH,IAAK,gBAA8D;AAAnE,WAAK,gBAAgB;IAAG,2EAAc,CAAA;IAAE,uEAAY,CAAA;IAAE,qEAAW,CAAA;AAAC,CAAC,EAA9D,gBAAgB,KAAhB,gBAAgB,QAA8C;AAEnE,kJAAkJ;AAClJ,MAAM,gBAAgB;IAOpB;QALQ,qBAAgB,GAAG,gBAAgB,CAAC,cAAc,CAAC;QAGnD,wBAAmB,GAAY,SAAS,CAAC;QAG/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACxD,IAAI,CAAC,2BAA2B,GAAG,OAAO,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,UAAU,CAAC,OAA0B;QACnC,IAAI,IAAI,C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AAI,CAAC,CAAC;SACpH;QACD,MAAM,IAAI,GAAG,MAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,IAAI,mCAAI,aAAa,CAAC;QAC3D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAErC,kEAAkE;QAClE,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,iVAAiV,CAAC,CAAC;QAChX,MAAM,CAAC,SAAS,GAAG;;;;;;;;;;;;;aAaV,UAAU;aACV,CAAC;QACV,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAChD,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,CAAA","sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nimport type { InitializeOptions, GoogleOneTapAuthPlugin, SignInResultPromises, SuccessSignInResult, SignOutResult, RenderSignInButtonOptions, NoSuccessSignInResult, SignInResultOption } from './definitions';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport jwt_decode from 'jwt-decode';\nimport type { NotEnrichedSuccessSignInResult, NotEnrichtedSignInResultOption } from './definitionsInternal';\n\nconst GoogleOneTapAuthPlatform = registerPlugin<GoogleOneTapAuthWeb>('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\n\nenum InitializeStatus { NotInitialized, Initializing, Initialized }\n\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth implements GoogleOneTapAuthPlugin {\n private nonce?: string;\n private initializeStatus = InitializeStatus.NotInitialized;\n private isInitializedPromise: Promise<void>;\n private resolveIsInitializedPromise: (() => void) | undefined;\n private authenticatedUserId?: string = undefined;\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options: InitializeOptions): Promise<void> {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise!();\n });\n }\n return this.isInitializedPromise;\n }\n\n private async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n\n async tryAutoOrOneTapSignIn(): Promise<SignInResultPromises> {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise) as NotEnrichtedSignInResultOption;\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success!.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success!),\n noSuccess: new Promise<NoSuccessSignInResult>(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n } else {\n return {\n successPromise: new Promise<SuccessSignInResult>(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess!),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n\n async signOut(): Promise<SignOutResult> {\n const result = await (GoogleOneTapAuthPlatform as any).signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n\n async addSignInActionToExistingButton(buttonParentId: string, buttonId: string): Promise<SuccessSignInResult> {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem!.style.position = 'relative';\n buttonParentElem!.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem!.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv!.style.position = 'absolute';\n invisibleGoogleButtonDiv!.style.top = '0px';\n invisibleGoogleButtonDiv!.style.left = '0px';\n invisibleGoogleButtonDiv!.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv!.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv!.style.opacity = '0.0001'; // change it for debugging\n buttonElem!.appendChild(invisibleGoogleButtonDiv);\n\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem!);\n } else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem!);\n }\n }\n\n async renderSignInButton(parentElementId: string, options: RenderSignInButtonOptions, gsiButtonConfiguration?: google.GsiButtonConfiguration): Promise<SuccessSignInResult> {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration)\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n\n async _doRenderSignInButton(parentElementId: string, options: RenderSignInButtonOptions, gsiButtonConfiguration: google.GsiButtonConfiguration | undefined, androidAndIosButtonElem: HTMLElement): Promise<SuccessSignInResult> {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n\n return new Promise<SuccessSignInResult>(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n\n const onClickAction = async () => {\n try {\n let notEnrichedSuccessSignInResult = await (GoogleOneTapAuthPlatform as any).triggerGoogleSignIn(options);\n if (Boolean(notEnrichedSuccessSignInResult.idToken)) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n } catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem!.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce!;\n }\n\n private enrichOptionResultWithDecodedIdToken(signInResultOption: NotEnrichtedSignInResultOption): SignInResultOption {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption as SignInResultOption;\n }\n return {\n ...signInResultOption,\n success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success!),\n } as SignInResultOption;\n }\n\n private enrichSuccessResultWithDecodedIdToken(successSignInResult: NotEnrichedSuccessSignInResult): SuccessSignInResult {\n const decodedJwt = jwt_decode(successSignInResult.idToken) as any;\n return {\n ...successSignInResult,\n decodedIdToken: decodedJwt,\n userId: decodedJwt.sub,\n email: decodedJwt.email,\n } as SuccessSignInResult;\n }\n\n private getSignInButtonHtml(gsiButtonConfiguration?: google.GsiButtonConfiguration) {\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n } as any;\n const locale = gsiButtonConfiguration?.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n\n if (localeTexts === undefined) {\n const countryCode = locale?.includes('-') === true ? locale.split('-')[1] : (locale ?? '');\n localeTexts = countryCode in localizedStrings ? (localizedStrings[countryCode] as string) : localizedStrings['en'];\n }\n const text = gsiButtonConfiguration?.text ?? 'signin_with';\n const buttonText = localeTexts[text];\n\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\n\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth }"]}
|
|
1
|
+
{"version":3,"file":"GoogleOneTapAuth.js","sourceRoot":"","sources":["../../src/GoogleOneTapAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,wBAAwB,GAAG,cAAc,CAAsB,kBAAkB,EAAE;IACvF,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE;CACrC,CAAC,CAAC;AAEH,IAAK,gBAA8D;AAAnE,WAAK,gBAAgB;IAAG,2EAAc,CAAA;IAAE,uEAAY,CAAA;IAAE,qEAAW,CAAA;AAAC,CAAC,EAA9D,gBAAgB,KAAhB,gBAAgB,QAA8C;AAEnE,kJAAkJ;AAClJ,MAAM,gBAAgB;IAOpB;QALQ,qBAAgB,GAAG,gBAAgB,CAAC,cAAc,CAAC;QAGnD,wBAAmB,GAAY,SAAS,CAAC;QAG/C,IAAI,CAAC,oBAAoB,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YACxD,IAAI,CAAC,2BAA2B,GAAG,OAAO,CAAC;QAC7C,CAAC,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,UAAU,CAAC,OAA0B;QACnC,IAAI,IAAI,CAAC,gBAAgB,KAAK,gBAA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AI,gBAAgB,CAAC,CAAC,CAAE,gBAAgB,CAAC,WAAW,CAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;SACpH;QACD,MAAM,IAAI,GAAG,MAAA,sBAAsB,aAAtB,sBAAsB,uBAAtB,sBAAsB,CAAE,IAAI,mCAAI,aAAa,CAAC;QAC3D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAErC,kEAAkE;QAClE,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAChD,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,iVAAiV,CAAC,CAAC;QAChX,MAAM,CAAC,SAAS,GAAG;;;;;;;;;;;;;aAaV,UAAU;aACV,CAAC;QACV,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAC;AAChD,OAAO,EAAE,gBAAgB,IAAI,gBAAgB,EAAE,CAAA","sourcesContent":["import { Capacitor, registerPlugin } from '@capacitor/core';\nimport type { InitializeOptions, GoogleOneTapAuthPlugin, SignInResultPromises, SuccessSignInResult, SignOutResult, RenderSignInButtonOptions, NoSuccessSignInResult, SignInResultOption } from './definitions';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport { jwtDecode } from \"jwt-decode\";\nimport type { NotEnrichedSuccessSignInResult, NotEnrichtedSignInResultOption } from './definitionsInternal';\n\nconst GoogleOneTapAuthPlatform = registerPlugin<GoogleOneTapAuthWeb>('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\n\nenum InitializeStatus { NotInitialized, Initializing, Initialized }\n\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth implements GoogleOneTapAuthPlugin {\n private nonce?: string;\n private initializeStatus = InitializeStatus.NotInitialized;\n private isInitializedPromise: Promise<void>;\n private resolveIsInitializedPromise: (() => void) | undefined;\n private authenticatedUserId?: string = undefined;\n\n constructor() {\n this.isInitializedPromise = new Promise<void>((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options: InitializeOptions): Promise<void> {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise!();\n });\n }\n return this.isInitializedPromise;\n }\n\n private async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n\n async tryAutoOrOneTapSignIn(): Promise<SignInResultPromises> {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise) as NotEnrichtedSignInResultOption;\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success!.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success!),\n noSuccess: new Promise<NoSuccessSignInResult>(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n } else {\n return {\n successPromise: new Promise<SuccessSignInResult>(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess!),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n\n async signOut(): Promise<SignOutResult> {\n const result = await (GoogleOneTapAuthPlatform as any).signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n\n async addSignInActionToExistingButton(buttonParentId: string, buttonId: string): Promise<SuccessSignInResult> {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem!.style.position = 'relative';\n buttonParentElem!.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem!.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv.style.position = 'absolute';\n invisibleGoogleButtonDiv.style.top = '0px';\n invisibleGoogleButtonDiv.style.left = '0px';\n invisibleGoogleButtonDiv.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv.style.opacity = '0.0001'; // change it for debugging\n buttonElem!.appendChild(invisibleGoogleButtonDiv);\n\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem!);\n } else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem!);\n }\n }\n\n async renderSignInButton(parentElementId: string, options: RenderSignInButtonOptions, gsiButtonConfiguration?: google.GsiButtonConfiguration): Promise<SuccessSignInResult> {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration)\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n\n async _doRenderSignInButton(parentElementId: string, options: RenderSignInButtonOptions, gsiButtonConfiguration: google.GsiButtonConfiguration | undefined, androidAndIosButtonElem: HTMLElement): Promise<SuccessSignInResult> {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n\n return new Promise<SuccessSignInResult>(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n\n const onClickAction = async () => {\n try {\n const notEnrichedSuccessSignInResult: SignInResultOption = await (GoogleOneTapAuthPlatform as any).triggerGoogleSignIn(options);\n if (notEnrichedSuccessSignInResult.isSuccess) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success!);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n else {\n if (notEnrichedSuccessSignInResult.noSuccess?.noSuccessReasonCode === 'SIGN_IN_CANCELLED') {\n // console.log('User cancelled sign in. Waiting for next sign in attempt.');\n }\n }\n } catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem!.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce!;\n }\n\n private enrichOptionResultWithDecodedIdToken(signInResultOption: NotEnrichtedSignInResultOption): SignInResultOption {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption as SignInResultOption;\n }\n return {\n ...signInResultOption,\n success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success!),\n } as SignInResultOption;\n }\n\n private enrichSuccessResultWithDecodedIdToken(successSignInResult: NotEnrichedSuccessSignInResult): SuccessSignInResult {\n const decodedJwt = jwtDecode(successSignInResult.idToken) as any;\n return {\n ...successSignInResult,\n decodedIdToken: decodedJwt,\n userId: decodedJwt.sub,\n email: decodedJwt.email,\n } as SuccessSignInResult;\n }\n\n private getSignInButtonHtml(gsiButtonConfiguration?: google.GsiButtonConfiguration) {\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n } as any;\n const locale = gsiButtonConfiguration?.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n\n if (localeTexts === undefined) {\n const countryCode = locale?.includes('-') === true ? locale.split('-')[1] : (locale ?? '');\n localeTexts = countryCode in localizedStrings ? (localizedStrings[countryCode] as string) : localizedStrings['en'];\n }\n const text = gsiButtonConfiguration?.text ?? 'signin_with';\n const buttonText = localeTexts[text];\n\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\n\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth }"]}
|
|
@@ -57,9 +57,9 @@ export interface SuccessSignInResult {
|
|
|
57
57
|
}
|
|
58
58
|
export interface NoSuccessSignInResult {
|
|
59
59
|
/**
|
|
60
|
-
* A reason code as '
|
|
60
|
+
* A reason code as 'tap_outside'.
|
|
61
61
|
* For the js library see google.PromptMomentNotification for possible values.
|
|
62
|
-
* For android 'SIGN_IN_CANCELLED' are currently set.
|
|
62
|
+
* For android and iOS 'SIGN_IN_CANCELLED' are currently set.
|
|
63
63
|
*/
|
|
64
64
|
noSuccessReasonCode?: string;
|
|
65
65
|
/**
|
|
@@ -83,6 +83,10 @@ export interface RenderSignInButtonWebOptions {
|
|
|
83
83
|
* The Sign In With Google button UX flow. The default value is 'popup'.
|
|
84
84
|
*/
|
|
85
85
|
uxMode?: 'popup' | 'redirect';
|
|
86
|
+
/**
|
|
87
|
+
* This field sets whether or not to cancel the One Tap request if a user clicks outside the prompt. The default value is true.
|
|
88
|
+
*/
|
|
89
|
+
cancelOnTapOutside?: boolean;
|
|
86
90
|
}
|
|
87
91
|
export interface SignOutResult {
|
|
88
92
|
isSuccess: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\nexport interface InitializeOptions {\n /**\n * Your client ID of type Web application.\n */\n clientId: string;\n /**\n * A string that is included in the ID token if supported. It is auto-generated if not provided.\n * The com.google.android.gms.auth.api.identity api supports nonce, however the \n * com.google.android.gms.auth.api.signin does currently not, and for ios there is an open issue.\n * See https://github.com/google/GoogleSignIn-iOS/issues/135\n */\n nonce?: string;\n}\n\nexport interface SignInResultPromises {\n successPromise: Promise<SuccessSignInResult>;\n noSuccess: Promise<NoSuccessSignInResult>;\n signInResultOptionPromise: Promise<SignInResultOption>;\n}\n\nexport interface SignInResultOption {\n /**\n * Indicates if the success or noSuccess property is set.\n */\n isSuccess: boolean;\n /**\n * Success result.\n */\n success?: SuccessSignInResult;\n /**\n * NoSuccess result.\n */\n noSuccess?: NoSuccessSignInResult;\n}\n\nexport interface SuccessSignInResult {\n /**\n * How the credential was retrieved.\n * Currently not available for android, only if the js library is used.\n * For possible values see google.PromptMomentNotification.\n */\n selectBy?: \n | 'auto'\n | 'user'\n | 'user_1tap'\n | 'user_2tap'\n | 'btn'\n | 'btn_confirm'\n | 'btn_add_session'\n | 'btn_confirm_add_session' // see google.CredentialResponse.select_by\n /**\n * The JWT token base64 encoded.\n */\n idToken: string;\n /**\n * A permanent id for the user.\n */\n userId: string;\n /**\n * The email address.\n */\n email: string;\n /**\n * The decoded JWT token.\n * The signature is not verified when decoding the token.\n */\n decodedIdToken: any;\n}\n\nexport interface NoSuccessSignInResult {\n /**\n * A reason code as '
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// <reference types=\"@capacitor/cli\" />\n\nexport interface InitializeOptions {\n /**\n * Your client ID of type Web application.\n */\n clientId: string;\n /**\n * A string that is included in the ID token if supported. It is auto-generated if not provided.\n * The com.google.android.gms.auth.api.identity api supports nonce, however the \n * com.google.android.gms.auth.api.signin does currently not, and for ios there is an open issue.\n * See https://github.com/google/GoogleSignIn-iOS/issues/135\n */\n nonce?: string;\n}\n\nexport interface SignInResultPromises {\n successPromise: Promise<SuccessSignInResult>;\n noSuccess: Promise<NoSuccessSignInResult>;\n signInResultOptionPromise: Promise<SignInResultOption>;\n}\n\nexport interface SignInResultOption {\n /**\n * Indicates if the success or noSuccess property is set.\n */\n isSuccess: boolean;\n /**\n * Success result.\n */\n success?: SuccessSignInResult;\n /**\n * NoSuccess result.\n */\n noSuccess?: NoSuccessSignInResult;\n}\n\nexport interface SuccessSignInResult {\n /**\n * How the credential was retrieved.\n * Currently not available for android, only if the js library is used.\n * For possible values see google.PromptMomentNotification.\n */\n selectBy?: \n | 'auto'\n | 'user'\n | 'user_1tap'\n | 'user_2tap'\n | 'btn'\n | 'btn_confirm'\n | 'btn_add_session'\n | 'btn_confirm_add_session' // see google.CredentialResponse.select_by\n /**\n * The JWT token base64 encoded.\n */\n idToken: string;\n /**\n * A permanent id for the user.\n */\n userId: string;\n /**\n * The email address.\n */\n email: string;\n /**\n * The decoded JWT token.\n * The signature is not verified when decoding the token.\n */\n decodedIdToken: any;\n}\n\nexport interface NoSuccessSignInResult {\n /**\n * A reason code as 'tap_outside'.\n * For the js library see google.PromptMomentNotification for possible values.\n * For android and iOS 'SIGN_IN_CANCELLED' are currently set.\n */\n noSuccessReasonCode?: string;\n /**\n * A error message.\n * Set in case of error if the native android code is used.\n */\n noSuccessAdditionalInfo?: string;\n}\n\nexport interface RenderSignInButtonOptions {\n /**\n * \tWeb platform specific options..\n */\n webOptions?: RenderSignInButtonWebOptions;\n}\n\nexport interface RenderSignInButtonWebOptions {\n /**\n * \tEnables upgraded One Tap UX on ITP browsers. The default value is false.\n */\n itpSupport?: boolean;\n /**\n * \tThe Sign In With Google button UX flow. The default value is 'popup'.\n */\n uxMode?: 'popup' | 'redirect';\n\n /**\n * This field sets whether or not to cancel the One Tap request if a user clicks outside the prompt. The default value is true.\n */\n cancelOnTapOutside?: boolean;\n}\n\nexport interface SignOutResult {\n isSuccess: boolean;\n error?: string;\n}\n\nexport interface GoogleOneTapAuthPlugin {\n /**\n * Performs common or one-time initializations.\n * For the web platform, starts pre-loading the google one tap JavaScript library.\n * initialize must be called before any other method.\n * initialize remembers if it was called so it is safe to be called multiple times.\n * Other methods wait till initialize is finished so you must not await initialize.\n * @param options \n */\n initialize(options: InitializeOptions): Promise<void>;\n /**\n * Tries to either auto-sign-in the user or sign-in the user with just one tap/click.\n * If there is a single google account and that account has previously signed into the app, \n * then that user is auto signed in. A short popover is displayed during sign-in.\n * If there are multiple google accounts and more than one have previously signed into the \n * app then a user selection screen is shown.\n * If there is no active google session or if no user session has logged in previously in \n * the app or if the user has opt out of One Tap, then the response will indicate that \n * the auto sign-in did not succeed.\n * See https://developers.google.com/identity/gsi/web/guides/features\n * @returns A Promise object that contains 3 properties with promises. One resolves only \n * when authentication succeeds, the second on error and the third on success or error.\n */\n tryAutoOrOneTapSignIn()\n : Promise<{\n successPromise: Promise<SuccessSignInResult>;\n noSuccess: Promise<NoSuccessSignInResult>;\n signInResultOptionPromise: Promise<SignInResultOption>;\n }>;\n /**\n * Allows using a custom sign-in button.\n * The element to which buttonParentId refers must have the style position: 'relative'.\n * For the web platform, the implementation renders the google button invisible in front of the passed button.\n * The returned promise will only resolve if successful.\n * The returned promise is rejected for unrecoverable errors as 'unregistered_origin' \n * for the web platform.\n * @param buttonParentId \n * @param buttonId\n */\n addSignInActionToExistingButton(\n buttonParentId: string,\n buttonId: string)\n : Promise<SuccessSignInResult>;\n /**\n * Renders the sign-in button.\n * The returned promise will only resolve if successful.\n * The returned promise is rejected for unrecoverable errors as 'unregistered_origin' \n * for the web platform.\n * @param parentElementId \n * @param options \n * @param gsiButtonConfiguration Not all button configuration options are supported on android.\n */\n renderSignInButton(\n parentElementId: string,\n options: RenderSignInButtonOptions,\n gsiButtonConfiguration?: google.GsiButtonConfiguration)\n : Promise<SuccessSignInResult>;\n /**\n * Ends the session.\n */\n signOut(): Promise<SignOutResult>;\n /**\n * Gets the last user defined or auto-created nonce.\n * Unfortunately not all google libraries support setting a nonce, so this is currently \n * not universally useful.\n */\n getNonce(): string;\n}\n"]}
|
package/dist/esm/web.js
CHANGED
|
@@ -89,9 +89,10 @@ export class GoogleOneTapAuthWeb extends WebPlugin {
|
|
|
89
89
|
callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),
|
|
90
90
|
auto_select: autoSelect,
|
|
91
91
|
itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,
|
|
92
|
-
cancel_on_tap_outside: true,
|
|
92
|
+
cancel_on_tap_outside: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.cancelOnTapOutside) || true,
|
|
93
93
|
ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',
|
|
94
94
|
nonce: this.nonce,
|
|
95
|
+
use_fedcm_for_prompt: true,
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
handleCredentialResponse(credentialResponse, resolveSignInFunc) {
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAW/C,+EAA+E;AAC/E,MAAM,OAAO,mBAAoB,SAAQ,SAAS;IAAlD;;QACE,iBAAY,GAAG,wCAAwC,CAAC;QACxD,sBAAiB,GAAmB,SAAS,CAAC;QAC9C,aAAQ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AE;oBACxD,IAAI,QAAQ,CAAC,UAAU,EAAE;wBACvB,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;qBAC9B;yBACI;wBACH,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;qBACtD;gBACH,CAAC,CAAC,CAAC;aACJ;iBAAM;gBACL,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aAC9B;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport { InitializeOptions, SignInResultOption, SuccessSignInResult, NoSuccessSignInResult, SignOutResult, RenderSignInButtonOptions, RenderSignInButtonWebOptions } from './definitions';\nimport { assert, loadScript } from './helpers';\nimport type { NotEnrichedSuccessSignInResult } from './definitionsInternal';\nimport { type IdConfiguration } from 'google-one-tap';\n\n// Workaround for 'error TS2686: 'google' refers to a UMD global, but the current file is a module. Consider adding an import instead.'\ndeclare var google: {\n accounts: google.accounts\n};\n\ntype ResolveSignInFunc = (result: NotEnrichedSuccessSignInResult) => void;\n\n// See https://developers.google.com/identity/gsi/web/guides/use-one-tap-js-api\nexport class GoogleOneTapAuthWeb extends WebPlugin {\n gsiScriptUrl = 'https://accounts.google.com/gsi/client';\n gapiLoadedPromise?: Promise<void> = undefined;\n clientId?: string = undefined;\n nonce?: string = undefined;\n\n async initialize(options: InitializeOptions): Promise<void> {\n this.clientId = options.clientId;\n this.nonce = options.nonce;\n if (!this.gapiLoadedPromise) {\n this.gapiLoadedPromise = loadScript(this.gsiScriptUrl);\n }\n return this.gapiLoadedPromise;\n }\n\n async tryAutoOrOneTapSignIn(): Promise<SignInResultOption> {\n let signInResult = await this.doSignIn(true);\n\n if (!(signInResult as SuccessSignInResult).idToken) {\n signInResult = await this.doSignIn(false);\n }\n\n if ((signInResult as SuccessSignInResult).idToken) {\n return {\n isSuccess: true,\n success: signInResult as SuccessSignInResult\n }\n } else {\n return {\n isSuccess: false,\n noSuccess: signInResult as NoSuccessSignInResult\n }\n }\n }\n\n async renderSignInButton(parentElementId: string, options: RenderSignInButtonOptions, gsiButtonConfiguration?: google.GsiButtonConfiguration): Promise<NotEnrichedSuccessSignInResult> {\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem)\n var signInPromise = new Promise<NotEnrichedSuccessSignInResult>((resolve) => {\n this.oneTapInitialize(false, resolve, options.webOptions);\n\n // // Adding a click_listener allows to detect when the popup is opened.\n // (gsiButtonConfiguration as any).click_listener = () => {\n // console.log('click_listener');\n // };\n google.accounts.id.renderButton(\n parentElem!,\n gsiButtonConfiguration!\n );\n });\n return signInPromise;\n }\n\n private async doSignIn(autoSelect: boolean) {\n var signInPromise = new Promise<NotEnrichedSuccessSignInResult | NoSuccessSignInResult>((resolve, reject) => {\n this.oneTapInitialize(autoSelect, resolve);\n\n google.accounts.id.prompt((notification) => {\n const developerErrors = ['missing_client_id', 'unregistered_origin'];\n const momentReason = this.getMomentReason(notification);\n\n if (momentReason !== undefined && developerErrors.includes(momentReason)) {\n reject({ errorCode: momentReason } as NoSuccessSignInResult);\n }\n else if (momentReason === 'credential_returned') {\n // Do nothing, handled in handleCredentialResponse.\n }\n else if (notification.isNotDisplayed()\n || notification.isSkippedMoment()\n || notification.isDismissedMoment()) {\n resolve({\n noSuccessReasonCode: momentReason\n });\n }\n });\n });\n return signInPromise;\n }\n\n private getMomentReason(notification: google.PromptMomentNotification) {\n if (notification.isNotDisplayed()) {\n return notification.getNotDisplayedReason();\n }\n if (notification.isSkippedMoment()) {\n return notification.getSkippedReason();\n }\n if (notification.isDismissedMoment()) {\n return notification.getDismissedReason();\n }\n return undefined;\n }\n\n private oneTapInitialize(autoSelect: boolean, resolveSignInFunc: ResolveSignInFunc, webOptions?: RenderSignInButtonWebOptions) {\n google.accounts.id.initialize({\n client_id: this.clientId!,\n callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),\n auto_select: autoSelect,\n itp_support: webOptions?.itpSupport || false,\n cancel_on_tap_outside: webOptions?.cancelOnTapOutside || true,\n ux_mode: webOptions?.uxMode || 'popup',\n nonce: this.nonce,\n use_fedcm_for_prompt: true,\n } as IdConfiguration & { use_fedcm_for_prompt: boolean });\n }\n\n private handleCredentialResponse(credentialResponse: google.CredentialResponse, resolveSignInFunc: ResolveSignInFunc) {\n let signInResult: NotEnrichedSuccessSignInResult = {\n idToken: credentialResponse.credential,\n selectBy: credentialResponse.select_by,\n };\n resolveSignInFunc(signInResult);\n }\n\n signOut(authenticatedUserId: string | undefined): Promise<SignOutResult> {\n return new Promise<SignOutResult>((resolve) => {\n google.accounts.id.cancel();\n\n if (authenticatedUserId) {\n // Calling revoke method revokes all OAuth2 scopes previously granted by the Sign In With Google client library.\n google.accounts.id.revoke(authenticatedUserId, response => {\n if (response.successful) {\n resolve({ isSuccess: true });\n }\n else {\n resolve({ isSuccess: false, error: response.error });\n }\n });\n } else {\n resolve({ isSuccess: true });\n }\n });\n }\n}"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var core = require('@capacitor/core');
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var jwt_decode__default = /*#__PURE__*/_interopDefaultLegacy(jwt_decode);
|
|
4
|
+
var jwtDecode = require('jwt-decode');
|
|
11
5
|
|
|
12
6
|
function assert(predicate, customMessage) {
|
|
13
7
|
if (!predicate()) {
|
|
@@ -131,9 +125,10 @@ class GoogleOneTapAuthWeb extends core.WebPlugin {
|
|
|
131
125
|
callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),
|
|
132
126
|
auto_select: autoSelect,
|
|
133
127
|
itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,
|
|
134
|
-
cancel_on_tap_outside: true,
|
|
128
|
+
cancel_on_tap_outside: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.cancelOnTapOutside) || true,
|
|
135
129
|
ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',
|
|
136
130
|
nonce: this.nonce,
|
|
131
|
+
use_fedcm_for_prompt: true,
|
|
137
132
|
});
|
|
138
133
|
}
|
|
139
134
|
handleCredentialResponse(credentialResponse, resolveSignInFunc) {
|
|
@@ -277,13 +272,19 @@ class GoogleOneTapAuth {
|
|
|
277
272
|
return;
|
|
278
273
|
}
|
|
279
274
|
const onClickAction = async () => {
|
|
275
|
+
var _a;
|
|
280
276
|
try {
|
|
281
|
-
|
|
282
|
-
if (
|
|
283
|
-
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);
|
|
277
|
+
const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);
|
|
278
|
+
if (notEnrichedSuccessSignInResult.isSuccess) {
|
|
279
|
+
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success);
|
|
284
280
|
this.authenticatedUserId = enrichtedSuccessSignInResult.userId;
|
|
285
281
|
resolve(enrichtedSuccessSignInResult);
|
|
286
282
|
}
|
|
283
|
+
else {
|
|
284
|
+
if (((_a = notEnrichedSuccessSignInResult.noSuccess) === null || _a === void 0 ? void 0 : _a.noSuccessReasonCode) === 'SIGN_IN_CANCELLED') {
|
|
285
|
+
// console.log('User cancelled sign in. Waiting for next sign in attempt.');
|
|
286
|
+
}
|
|
287
|
+
}
|
|
287
288
|
}
|
|
288
289
|
catch (e) {
|
|
289
290
|
reject(e);
|
|
@@ -308,7 +309,7 @@ class GoogleOneTapAuth {
|
|
|
308
309
|
return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });
|
|
309
310
|
}
|
|
310
311
|
enrichSuccessResultWithDecodedIdToken(successSignInResult) {
|
|
311
|
-
const decodedJwt =
|
|
312
|
+
const decodedJwt = jwtDecode.jwtDecode(successSignInResult.idToken);
|
|
312
313
|
return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });
|
|
313
314
|
}
|
|
314
315
|
getSignInButtonHtml(gsiButtonConfiguration) {
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/helpers.js","esm/web.js","esm/GoogleOneTapAuth.js"],"sourcesContent":["export function assert(predicate, customMessage) {\n if (!predicate()) {\n const callerName = callingFunctionName();\n if (customMessage != undefined) {\n throw Error(customMessage + `. Error in ${callerName}.`);\n }\n throw Error(`Assert error, expected '${predicate}' to be true. Error in ${callerName}.`);\n }\n}\nexport function randomHexString(length) {\n let uint8RandomNumbers = new Uint8Array((length / 2) + 1);\n uint8RandomNumbers = crypto.getRandomValues(uint8RandomNumbers);\n const numbersAsHexString = Array.from(uint8RandomNumbers).map(x => x.toString(16)).join('');\n return numbersAsHexString.substring(0, length);\n}\nfunction callingFunctionName() {\n var _a;\n try {\n return (_a = (new Error()).stack) === null || _a === void 0 ? void 0 : _a.split(\"\\n\")[3].trim().split(\" \")[1];\n }\n catch (_b) {\n // ignore.\n }\n}\nexport function loadScript(url) {\n return new Promise((resolve, reject) => {\n var scriptEl = document.createElement('script');\n scriptEl.async = true;\n scriptEl.onerror = () => reject();\n scriptEl.onload = () => resolve();\n scriptEl.src = url;\n document.getElementsByTagName('head')[0].appendChild(scriptEl);\n });\n}\n//# sourceMappingURL=helpers.js.map","import { WebPlugin } from '@capacitor/core';\nimport { assert, loadScript } from './helpers';\n// See https://developers.google.com/identity/gsi/web/guides/use-one-tap-js-api\nexport class GoogleOneTapAuthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.gsiScriptUrl = 'https://accounts.google.com/gsi/client';\n this.gapiLoadedPromise = undefined;\n this.clientId = undefined;\n this.nonce = undefined;\n }\n async initialize(options) {\n this.clientId = options.clientId;\n this.nonce = options.nonce;\n if (!this.gapiLoadedPromise) {\n this.gapiLoadedPromise = loadScript(this.gsiScriptUrl);\n }\n return this.gapiLoadedPromise;\n }\n async tryAutoOrOneTapSignIn() {\n let signInResult = await this.doSignIn(true);\n if (!signInResult.idToken) {\n signInResult = await this.doSignIn(false);\n }\n if (signInResult.idToken) {\n return {\n isSuccess: true,\n success: signInResult\n };\n }\n else {\n return {\n isSuccess: false,\n noSuccess: signInResult\n };\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n var signInPromise = new Promise((resolve) => {\n this.oneTapInitialize(false, resolve, options.webOptions);\n // // Adding a click_listener allows to detect when the popup is opened.\n // (gsiButtonConfiguration as any).click_listener = () => {\n // console.log('click_listener');\n // };\n google.accounts.id.renderButton(parentElem, gsiButtonConfiguration);\n });\n return signInPromise;\n }\n async doSignIn(autoSelect) {\n var signInPromise = new Promise((resolve, reject) => {\n this.oneTapInitialize(autoSelect, resolve);\n google.accounts.id.prompt((notification) => {\n const developerErrors = ['missing_client_id', 'unregistered_origin'];\n const momentReason = this.getMomentReason(notification);\n if (momentReason !== undefined && developerErrors.includes(momentReason)) {\n reject({ errorCode: momentReason });\n }\n else if (momentReason === 'credential_returned') {\n // Do nothing, handled in handleCredentialResponse.\n }\n else if (notification.isNotDisplayed()\n || notification.isSkippedMoment()\n || notification.isDismissedMoment()) {\n resolve({\n noSuccessReasonCode: momentReason\n });\n }\n });\n });\n return signInPromise;\n }\n getMomentReason(notification) {\n if (notification.isNotDisplayed()) {\n return notification.getNotDisplayedReason();\n }\n if (notification.isSkippedMoment()) {\n return notification.getSkippedReason();\n }\n if (notification.isDismissedMoment()) {\n return notification.getDismissedReason();\n }\n return undefined;\n }\n oneTapInitialize(autoSelect, resolveSignInFunc, webOptions) {\n google.accounts.id.initialize({\n client_id: this.clientId,\n callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),\n auto_select: autoSelect,\n itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,\n cancel_on_tap_outside: true,\n ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',\n nonce: this.nonce,\n });\n }\n handleCredentialResponse(credentialResponse, resolveSignInFunc) {\n let signInResult = {\n idToken: credentialResponse.credential,\n selectBy: credentialResponse.select_by,\n };\n resolveSignInFunc(signInResult);\n }\n signOut(authenticatedUserId) {\n return new Promise((resolve) => {\n google.accounts.id.cancel();\n if (authenticatedUserId) {\n // Calling revoke method revokes all OAuth2 scopes previously granted by the Sign In With Google client library.\n google.accounts.id.revoke(authenticatedUserId, response => {\n if (response.successful) {\n resolve({ isSuccess: true });\n }\n else {\n resolve({ isSuccess: false, error: response.error });\n }\n });\n }\n else {\n resolve({ isSuccess: true });\n }\n });\n }\n}\n//# sourceMappingURL=web.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport jwt_decode from 'jwt-decode';\nconst GoogleOneTapAuthPlatform = registerPlugin('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\nvar InitializeStatus;\n(function (InitializeStatus) {\n InitializeStatus[InitializeStatus[\"NotInitialized\"] = 0] = \"NotInitialized\";\n InitializeStatus[InitializeStatus[\"Initializing\"] = 1] = \"Initializing\";\n InitializeStatus[InitializeStatus[\"Initialized\"] = 2] = \"Initialized\";\n})(InitializeStatus || (InitializeStatus = {}));\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth {\n constructor() {\n this.initializeStatus = InitializeStatus.NotInitialized;\n this.authenticatedUserId = undefined;\n this.isInitializedPromise = new Promise((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options) {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise();\n });\n }\n return this.isInitializedPromise;\n }\n async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n async tryAutoOrOneTapSignIn() {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise);\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success),\n noSuccess: new Promise(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n else {\n return {\n successPromise: new Promise(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n async signOut() {\n const result = await GoogleOneTapAuthPlatform.signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n async addSignInActionToExistingButton(buttonParentId, buttonId) {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem.style.position = 'relative';\n buttonParentElem.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv.style.position = 'absolute';\n invisibleGoogleButtonDiv.style.top = '0px';\n invisibleGoogleButtonDiv.style.left = '0px';\n invisibleGoogleButtonDiv.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv.style.opacity = '0.0001'; // change it for debugging\n buttonElem.appendChild(invisibleGoogleButtonDiv);\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem);\n }\n else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem);\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration);\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n async _doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem) {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n return new Promise(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n const onClickAction = async () => {\n try {\n let notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);\n if (Boolean(notEnrichedSuccessSignInResult.idToken)) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n }\n catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce;\n }\n enrichOptionResultWithDecodedIdToken(signInResultOption) {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption;\n }\n return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });\n }\n enrichSuccessResultWithDecodedIdToken(successSignInResult) {\n const decodedJwt = jwt_decode(successSignInResult.idToken);\n return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });\n }\n getSignInButtonHtml(gsiButtonConfiguration) {\n var _a;\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n };\n const locale = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n if (localeTexts === undefined) {\n const countryCode = (locale === null || locale === void 0 ? void 0 : locale.includes('-')) === true ? locale.split('-')[1] : (locale !== null && locale !== void 0 ? locale : '');\n localeTexts = countryCode in localizedStrings ? localizedStrings[countryCode] : localizedStrings['en'];\n }\n const text = (_a = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.text) !== null && _a !== void 0 ? _a : 'signin_with';\n const buttonText = localeTexts[text];\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth };\n//# sourceMappingURL=GoogleOneTapAuth.js.map"],"names":["WebPlugin","registerPlugin","Capacitor","jwt_decode"],"mappings":";;;;;;;;;;;AAAO,SAAS,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE;AACjD,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;AACtB,QAAQ,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;AACjD,QAAQ,IAAI,aAAa,IAAI,SAAS,EAAE;AACxC,YAAY,MAAM,KAAK,CAAC,aAAa,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,SAAS;AACT,QAAQ,MAAM,KAAK,CAAC,CAAC,wBAAwB,EAAE,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACjG,KAAK;AACL,CAAC;AACM,SAAS,eAAe,CAAC,MAAM,EAAE;AACxC,IAAI,IAAI,kBAAkB,GAAG,IAAI,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,IAAI,kBAAkB,GAAG,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;AACpE,IAAI,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAChG,IAAI,OAAO,kBAAkB,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AACD,SAAS,mBAAmB,GAAG;AAC/B,IAAI,IAAI,EAAE,CAAC;AACX,IAAI,IAAI;AACR,QAAQ,OAAO,CAAC,EAAE,GAAG,CAAC,IAAI,KAAK,EAAE,EAAE,KAAK,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC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KAAK,CAAC,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC;AAC9L,YAAY,WAAW,GAAG,WAAW,IAAI,gBAAgB,GAAG,gBAAgB,CAAC,WAAW,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;AACnH,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,sBAAsB,KAAK,IAAI,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,sBAAsB,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC;AACvL,QAAQ,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7C;AACA,QAAQ,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACxD,QAAQ,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,iVAAiV,CAAC,CAAC;AACxX,QAAQ,MAAM,CAAC,SAAS,GAAG,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU,CAAC;AACxB,YAAY,CAAC,CAAC;AACd,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,CAAC;AACI,MAAC,gBAAgB,GAAG,IAAI,gBAAgB;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/helpers.js","esm/web.js","esm/GoogleOneTapAuth.js"],"sourcesContent":["export function assert(predicate, customMessage) {\n if (!predicate()) {\n const callerName = callingFunctionName();\n if (customMessage != undefined) {\n throw Error(customMessage + `. Error in ${callerName}.`);\n }\n throw Error(`Assert error, expected '${predicate}' to be true. Error in ${callerName}.`);\n }\n}\nexport function randomHexString(length) {\n let uint8RandomNumbers = new Uint8Array((length / 2) + 1);\n uint8RandomNumbers = crypto.getRandomValues(uint8RandomNumbers);\n const numbersAsHexString = Array.from(uint8RandomNumbers).map(x => x.toString(16)).join('');\n return numbersAsHexString.substring(0, length);\n}\nfunction callingFunctionName() {\n var _a;\n try {\n return (_a = (new Error()).stack) === null || _a === void 0 ? void 0 : _a.split(\"\\n\")[3].trim().split(\" \")[1];\n }\n catch (_b) {\n // ignore.\n }\n}\nexport function loadScript(url) {\n return new Promise((resolve, reject) => {\n var scriptEl = document.createElement('script');\n scriptEl.async = true;\n scriptEl.onerror = () => reject();\n scriptEl.onload = () => resolve();\n scriptEl.src = url;\n document.getElementsByTagName('head')[0].appendChild(scriptEl);\n });\n}\n//# sourceMappingURL=helpers.js.map","import { WebPlugin } from '@capacitor/core';\nimport { assert, loadScript } from './helpers';\n// See https://developers.google.com/identity/gsi/web/guides/use-one-tap-js-api\nexport class GoogleOneTapAuthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.gsiScriptUrl = 'https://accounts.google.com/gsi/client';\n this.gapiLoadedPromise = undefined;\n this.clientId = undefined;\n this.nonce = undefined;\n }\n async initialize(options) {\n this.clientId = options.clientId;\n this.nonce = options.nonce;\n if (!this.gapiLoadedPromise) {\n this.gapiLoadedPromise = loadScript(this.gsiScriptUrl);\n }\n return this.gapiLoadedPromise;\n }\n async tryAutoOrOneTapSignIn() {\n let signInResult = await this.doSignIn(true);\n if (!signInResult.idToken) {\n signInResult = await this.doSignIn(false);\n }\n if (signInResult.idToken) {\n return {\n isSuccess: true,\n success: signInResult\n };\n }\n else {\n return {\n isSuccess: false,\n noSuccess: signInResult\n };\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n var signInPromise = new Promise((resolve) => {\n this.oneTapInitialize(false, resolve, options.webOptions);\n // // Adding a click_listener allows to detect when the popup is opened.\n // (gsiButtonConfiguration as any).click_listener = () => {\n // console.log('click_listener');\n // };\n google.accounts.id.renderButton(parentElem, gsiButtonConfiguration);\n });\n return signInPromise;\n }\n async doSignIn(autoSelect) {\n var signInPromise = new Promise((resolve, reject) => {\n this.oneTapInitialize(autoSelect, resolve);\n google.accounts.id.prompt((notification) => {\n const developerErrors = ['missing_client_id', 'unregistered_origin'];\n const momentReason = this.getMomentReason(notification);\n if (momentReason !== undefined && developerErrors.includes(momentReason)) {\n reject({ errorCode: momentReason });\n }\n else if (momentReason === 'credential_returned') {\n // Do nothing, handled in handleCredentialResponse.\n }\n else if (notification.isNotDisplayed()\n || notification.isSkippedMoment()\n || notification.isDismissedMoment()) {\n resolve({\n noSuccessReasonCode: momentReason\n });\n }\n });\n });\n return signInPromise;\n }\n getMomentReason(notification) {\n if (notification.isNotDisplayed()) {\n return notification.getNotDisplayedReason();\n }\n if (notification.isSkippedMoment()) {\n return notification.getSkippedReason();\n }\n if (notification.isDismissedMoment()) {\n return notification.getDismissedReason();\n }\n return undefined;\n }\n oneTapInitialize(autoSelect, resolveSignInFunc, webOptions) {\n google.accounts.id.initialize({\n client_id: this.clientId,\n callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),\n auto_select: autoSelect,\n itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,\n cancel_on_tap_outside: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.cancelOnTapOutside) || true,\n ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',\n nonce: this.nonce,\n use_fedcm_for_prompt: true,\n });\n }\n handleCredentialResponse(credentialResponse, resolveSignInFunc) {\n let signInResult = {\n idToken: credentialResponse.credential,\n selectBy: credentialResponse.select_by,\n };\n resolveSignInFunc(signInResult);\n }\n signOut(authenticatedUserId) {\n return new Promise((resolve) => {\n google.accounts.id.cancel();\n if (authenticatedUserId) {\n // Calling revoke method revokes all OAuth2 scopes previously granted by the Sign In With Google client library.\n google.accounts.id.revoke(authenticatedUserId, response => {\n if (response.successful) {\n resolve({ isSuccess: true });\n }\n else {\n resolve({ isSuccess: false, error: response.error });\n }\n });\n }\n else {\n resolve({ isSuccess: true });\n }\n });\n }\n}\n//# sourceMappingURL=web.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport { jwtDecode } from \"jwt-decode\";\nconst GoogleOneTapAuthPlatform = registerPlugin('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\nvar InitializeStatus;\n(function (InitializeStatus) {\n InitializeStatus[InitializeStatus[\"NotInitialized\"] = 0] = \"NotInitialized\";\n InitializeStatus[InitializeStatus[\"Initializing\"] = 1] = \"Initializing\";\n InitializeStatus[InitializeStatus[\"Initialized\"] = 2] = \"Initialized\";\n})(InitializeStatus || (InitializeStatus = {}));\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth {\n constructor() {\n this.initializeStatus = InitializeStatus.NotInitialized;\n this.authenticatedUserId = undefined;\n this.isInitializedPromise = new Promise((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options) {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise();\n });\n }\n return this.isInitializedPromise;\n }\n async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n async tryAutoOrOneTapSignIn() {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise);\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success),\n noSuccess: new Promise(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n else {\n return {\n successPromise: new Promise(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n async signOut() {\n const result = await GoogleOneTapAuthPlatform.signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n async addSignInActionToExistingButton(buttonParentId, buttonId) {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem.style.position = 'relative';\n buttonParentElem.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv.style.position = 'absolute';\n invisibleGoogleButtonDiv.style.top = '0px';\n invisibleGoogleButtonDiv.style.left = '0px';\n invisibleGoogleButtonDiv.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv.style.opacity = '0.0001'; // change it for debugging\n buttonElem.appendChild(invisibleGoogleButtonDiv);\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem);\n }\n else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem);\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration);\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n async _doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem) {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n return new Promise(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n const onClickAction = async () => {\n var _a;\n try {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);\n if (notEnrichedSuccessSignInResult.isSuccess) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n else {\n if (((_a = notEnrichedSuccessSignInResult.noSuccess) === null || _a === void 0 ? void 0 : _a.noSuccessReasonCode) === 'SIGN_IN_CANCELLED') {\n // console.log('User cancelled sign in. Waiting for next sign in attempt.');\n }\n }\n }\n catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce;\n }\n enrichOptionResultWithDecodedIdToken(signInResultOption) {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption;\n }\n return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });\n }\n enrichSuccessResultWithDecodedIdToken(successSignInResult) {\n const decodedJwt = jwtDecode(successSignInResult.idToken);\n return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });\n }\n getSignInButtonHtml(gsiButtonConfiguration) {\n var _a;\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n };\n const locale = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n if (localeTexts === undefined) {\n const countryCode = (locale === null || locale === void 0 ? void 0 : locale.includes('-')) === true ? locale.split('-')[1] : (locale !== null && locale !== void 0 ? locale : '');\n localeTexts = countryCode in localizedStrings ? localizedStrings[countryCode] : localizedStrings['en'];\n }\n const text = (_a = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.text) !== null && _a !== void 0 ? _a : 'signin_with';\n const buttonText = localeTexts[text];\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth };\n//# sourceMappingURL=GoogleOneTapAuth.js.map"],"names":["WebPlugin","registerPlugin","Capacitor","jwtDecode"],"mappings":";;;;;AAAO,SAAS,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE;AACjD,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;AACtB,QAAQ,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;AACjD,QAAQ,IAAI,aAAa,IAAI,SAAS,EAAE;AACxC,YAAY,MAAM,KAAK,CAAC,aAAa,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;AACrE,SAAS;AACT,QAAQ,MAAM,KAAK,CAAC,CAAC,wBAAwB,EAAE,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAA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AAC;AACnH,SAAS;AACT,QAAQ,MAAM,IAAI,GAAG,CAAC,EAAE,GAAG,sBAAsB,KAAK,IAAI,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,sBAAsB,CAAC,IAAI,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC;AACvL,QAAQ,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7C;AACA,QAAQ,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACxD,QAAQ,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,iVAAiV,CAAC,CAAC;AACxX,QAAQ,MAAM,CAAC,SAAS,GAAG,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU,CAAC;AACxB,YAAY,CAAC,CAAC;AACd,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,CAAC;AACI,MAAC,gBAAgB,GAAG,IAAI,gBAAgB;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
var capacitorNativeGoogleOneTapSignin = (function (exports, core,
|
|
1
|
+
var capacitorNativeGoogleOneTapSignin = (function (exports, core, jwtDecode) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
5
|
-
|
|
6
|
-
var jwt_decode__default = /*#__PURE__*/_interopDefaultLegacy(jwt_decode);
|
|
7
|
-
|
|
8
4
|
function assert(predicate, customMessage) {
|
|
9
5
|
if (!predicate()) {
|
|
10
6
|
const callerName = callingFunctionName();
|
|
@@ -127,9 +123,10 @@ var capacitorNativeGoogleOneTapSignin = (function (exports, core, jwt_decode) {
|
|
|
127
123
|
callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),
|
|
128
124
|
auto_select: autoSelect,
|
|
129
125
|
itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,
|
|
130
|
-
cancel_on_tap_outside: true,
|
|
126
|
+
cancel_on_tap_outside: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.cancelOnTapOutside) || true,
|
|
131
127
|
ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',
|
|
132
128
|
nonce: this.nonce,
|
|
129
|
+
use_fedcm_for_prompt: true,
|
|
133
130
|
});
|
|
134
131
|
}
|
|
135
132
|
handleCredentialResponse(credentialResponse, resolveSignInFunc) {
|
|
@@ -273,13 +270,19 @@ var capacitorNativeGoogleOneTapSignin = (function (exports, core, jwt_decode) {
|
|
|
273
270
|
return;
|
|
274
271
|
}
|
|
275
272
|
const onClickAction = async () => {
|
|
273
|
+
var _a;
|
|
276
274
|
try {
|
|
277
|
-
|
|
278
|
-
if (
|
|
279
|
-
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);
|
|
275
|
+
const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);
|
|
276
|
+
if (notEnrichedSuccessSignInResult.isSuccess) {
|
|
277
|
+
const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success);
|
|
280
278
|
this.authenticatedUserId = enrichtedSuccessSignInResult.userId;
|
|
281
279
|
resolve(enrichtedSuccessSignInResult);
|
|
282
280
|
}
|
|
281
|
+
else {
|
|
282
|
+
if (((_a = notEnrichedSuccessSignInResult.noSuccess) === null || _a === void 0 ? void 0 : _a.noSuccessReasonCode) === 'SIGN_IN_CANCELLED') {
|
|
283
|
+
// console.log('User cancelled sign in. Waiting for next sign in attempt.');
|
|
284
|
+
}
|
|
285
|
+
}
|
|
283
286
|
}
|
|
284
287
|
catch (e) {
|
|
285
288
|
reject(e);
|
|
@@ -304,7 +307,7 @@ var capacitorNativeGoogleOneTapSignin = (function (exports, core, jwt_decode) {
|
|
|
304
307
|
return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });
|
|
305
308
|
}
|
|
306
309
|
enrichSuccessResultWithDecodedIdToken(successSignInResult) {
|
|
307
|
-
const decodedJwt =
|
|
310
|
+
const decodedJwt = jwtDecode.jwtDecode(successSignInResult.idToken);
|
|
308
311
|
return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });
|
|
309
312
|
}
|
|
310
313
|
getSignInButtonHtml(gsiButtonConfiguration) {
|
|
@@ -370,9 +373,7 @@ var capacitorNativeGoogleOneTapSignin = (function (exports, core, jwt_decode) {
|
|
|
370
373
|
|
|
371
374
|
exports.GoogleOneTapAuth = googleOneTapAuth;
|
|
372
375
|
|
|
373
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
374
|
-
|
|
375
376
|
return exports;
|
|
376
377
|
|
|
377
|
-
})({}, capacitorExports,
|
|
378
|
+
})({}, capacitorExports, jwtDecode);
|
|
378
379
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/helpers.js","esm/web.js","esm/GoogleOneTapAuth.js"],"sourcesContent":["export function assert(predicate, customMessage) {\n if (!predicate()) {\n const callerName = callingFunctionName();\n if (customMessage != undefined) {\n throw Error(customMessage + `. Error in ${callerName}.`);\n }\n throw Error(`Assert error, expected '${predicate}' to be true. Error in ${callerName}.`);\n }\n}\nexport function randomHexString(length) {\n let uint8RandomNumbers = new Uint8Array((length / 2) + 1);\n uint8RandomNumbers = crypto.getRandomValues(uint8RandomNumbers);\n const numbersAsHexString = Array.from(uint8RandomNumbers).map(x => x.toString(16)).join('');\n return numbersAsHexString.substring(0, length);\n}\nfunction callingFunctionName() {\n var _a;\n try {\n return (_a = (new Error()).stack) === null || _a === void 0 ? void 0 : _a.split(\"\\n\")[3].trim().split(\" \")[1];\n }\n catch (_b) {\n // ignore.\n }\n}\nexport function loadScript(url) {\n return new Promise((resolve, reject) => {\n var scriptEl = document.createElement('script');\n scriptEl.async = true;\n scriptEl.onerror = () => reject();\n scriptEl.onload = () => resolve();\n scriptEl.src = url;\n document.getElementsByTagName('head')[0].appendChild(scriptEl);\n });\n}\n//# sourceMappingURL=helpers.js.map","import { WebPlugin } from '@capacitor/core';\nimport { assert, loadScript } from './helpers';\n// See https://developers.google.com/identity/gsi/web/guides/use-one-tap-js-api\nexport class GoogleOneTapAuthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.gsiScriptUrl = 'https://accounts.google.com/gsi/client';\n this.gapiLoadedPromise = undefined;\n this.clientId = undefined;\n this.nonce = undefined;\n }\n async initialize(options) {\n this.clientId = options.clientId;\n this.nonce = options.nonce;\n if (!this.gapiLoadedPromise) {\n this.gapiLoadedPromise = loadScript(this.gsiScriptUrl);\n }\n return this.gapiLoadedPromise;\n }\n async tryAutoOrOneTapSignIn() {\n let signInResult = await this.doSignIn(true);\n if (!signInResult.idToken) {\n signInResult = await this.doSignIn(false);\n }\n if (signInResult.idToken) {\n return {\n isSuccess: true,\n success: signInResult\n };\n }\n else {\n return {\n isSuccess: false,\n noSuccess: signInResult\n };\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n var signInPromise = new Promise((resolve) => {\n this.oneTapInitialize(false, resolve, options.webOptions);\n // // Adding a click_listener allows to detect when the popup is opened.\n // (gsiButtonConfiguration as any).click_listener = () => {\n // console.log('click_listener');\n // };\n google.accounts.id.renderButton(parentElem, gsiButtonConfiguration);\n });\n return signInPromise;\n }\n async doSignIn(autoSelect) {\n var signInPromise = new Promise((resolve, reject) => {\n this.oneTapInitialize(autoSelect, resolve);\n google.accounts.id.prompt((notification) => {\n const developerErrors = ['missing_client_id', 'unregistered_origin'];\n const momentReason = this.getMomentReason(notification);\n if (momentReason !== undefined && developerErrors.includes(momentReason)) {\n reject({ errorCode: momentReason });\n }\n else if (momentReason === 'credential_returned') {\n // Do nothing, handled in handleCredentialResponse.\n }\n else if (notification.isNotDisplayed()\n || notification.isSkippedMoment()\n || notification.isDismissedMoment()) {\n resolve({\n noSuccessReasonCode: momentReason\n });\n }\n });\n });\n return signInPromise;\n }\n getMomentReason(notification) {\n if (notification.isNotDisplayed()) {\n return notification.getNotDisplayedReason();\n }\n if (notification.isSkippedMoment()) {\n return notification.getSkippedReason();\n }\n if (notification.isDismissedMoment()) {\n return notification.getDismissedReason();\n }\n return undefined;\n }\n oneTapInitialize(autoSelect, resolveSignInFunc, webOptions) {\n google.accounts.id.initialize({\n client_id: this.clientId,\n callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),\n auto_select: autoSelect,\n itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,\n cancel_on_tap_outside: true,\n ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',\n nonce: this.nonce,\n });\n }\n handleCredentialResponse(credentialResponse, resolveSignInFunc) {\n let signInResult = {\n idToken: credentialResponse.credential,\n selectBy: credentialResponse.select_by,\n };\n resolveSignInFunc(signInResult);\n }\n signOut(authenticatedUserId) {\n return new Promise((resolve) => {\n google.accounts.id.cancel();\n if (authenticatedUserId) {\n // Calling revoke method revokes all OAuth2 scopes previously granted by the Sign In With Google client library.\n google.accounts.id.revoke(authenticatedUserId, response => {\n if (response.successful) {\n resolve({ isSuccess: true });\n }\n else {\n resolve({ isSuccess: false, error: response.error });\n }\n });\n }\n else {\n resolve({ isSuccess: true });\n }\n });\n }\n}\n//# sourceMappingURL=web.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport jwt_decode from 'jwt-decode';\nconst GoogleOneTapAuthPlatform = registerPlugin('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\nvar InitializeStatus;\n(function (InitializeStatus) {\n InitializeStatus[InitializeStatus[\"NotInitialized\"] = 0] = \"NotInitialized\";\n InitializeStatus[InitializeStatus[\"Initializing\"] = 1] = \"Initializing\";\n InitializeStatus[InitializeStatus[\"Initialized\"] = 2] = \"Initialized\";\n})(InitializeStatus || (InitializeStatus = {}));\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth {\n constructor() {\n this.initializeStatus = InitializeStatus.NotInitialized;\n this.authenticatedUserId = undefined;\n this.isInitializedPromise = new Promise((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options) {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise();\n });\n }\n return this.isInitializedPromise;\n }\n async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n async tryAutoOrOneTapSignIn() {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise);\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success),\n noSuccess: new Promise(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n else {\n return {\n successPromise: new Promise(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n async signOut() {\n const result = await GoogleOneTapAuthPlatform.signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n async addSignInActionToExistingButton(buttonParentId, buttonId) {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem.style.position = 'relative';\n buttonParentElem.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv.style.position = 'absolute';\n invisibleGoogleButtonDiv.style.top = '0px';\n invisibleGoogleButtonDiv.style.left = '0px';\n invisibleGoogleButtonDiv.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv.style.opacity = '0.0001'; // change it for debugging\n buttonElem.appendChild(invisibleGoogleButtonDiv);\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem);\n }\n else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem);\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration);\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n async _doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem) {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n return new Promise(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n const onClickAction = async () => {\n try {\n let notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);\n if (Boolean(notEnrichedSuccessSignInResult.idToken)) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n }\n catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce;\n }\n enrichOptionResultWithDecodedIdToken(signInResultOption) {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption;\n }\n return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });\n }\n enrichSuccessResultWithDecodedIdToken(successSignInResult) {\n const decodedJwt = jwt_decode(successSignInResult.idToken);\n return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });\n }\n getSignInButtonHtml(gsiButtonConfiguration) {\n var _a;\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n };\n const locale = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n if (localeTexts === undefined) {\n const countryCode = (locale === null || locale === void 0 ? void 0 : locale.includes('-')) === true ? locale.split('-')[1] : (locale !== null && locale !== void 0 ? locale : '');\n localeTexts = countryCode in localizedStrings ? localizedStrings[countryCode] : localizedStrings['en'];\n }\n const text = (_a = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.text) !== null && _a !== void 0 ? _a : 'signin_with';\n const buttonText = localeTexts[text];\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth };\n//# sourceMappingURL=GoogleOneTapAuth.js.map"],"names":["WebPlugin","registerPlugin","Capacitor","jwt_decode"],"mappings":";;;;;;;IAAO,SAAS,MAAM,CAAC,SAAS,EAAE,aAAa,EAAE;IACjD,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;IACtB,QAAQ,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;IACjD,QAAQ,IAAI,aAAa,IAAI,SAAS,EAAE;IACxC,YAAY,MAAM,KAAK,CAAC,aAAa,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,SAAS;IACT,QAAQ,MAAM,KAAK,CAAC,CAAC,wBAAwB,EAAE,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,KAAK;IACL,CAAC;IACM,SAAS,eAAe,CAAC,MAAM,EAAE;IACxC,IAAI,IAAI,kBAAkB,GAAG,IAAI,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9D,IAAI,kBAAkB,GAAG,MAAM,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACpE,IAAI,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,CA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AgB,GAAG,IAAI,gBAAgB;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/helpers.js","esm/web.js","esm/GoogleOneTapAuth.js"],"sourcesContent":["export function assert(predicate, customMessage) {\n if (!predicate()) {\n const callerName = callingFunctionName();\n if (customMessage != undefined) {\n throw Error(customMessage + `. Error in ${callerName}.`);\n }\n throw Error(`Assert error, expected '${predicate}' to be true. Error in ${callerName}.`);\n }\n}\nexport function randomHexString(length) {\n let uint8RandomNumbers = new Uint8Array((length / 2) + 1);\n uint8RandomNumbers = crypto.getRandomValues(uint8RandomNumbers);\n const numbersAsHexString = Array.from(uint8RandomNumbers).map(x => x.toString(16)).join('');\n return numbersAsHexString.substring(0, length);\n}\nfunction callingFunctionName() {\n var _a;\n try {\n return (_a = (new Error()).stack) === null || _a === void 0 ? void 0 : _a.split(\"\\n\")[3].trim().split(\" \")[1];\n }\n catch (_b) {\n // ignore.\n }\n}\nexport function loadScript(url) {\n return new Promise((resolve, reject) => {\n var scriptEl = document.createElement('script');\n scriptEl.async = true;\n scriptEl.onerror = () => reject();\n scriptEl.onload = () => resolve();\n scriptEl.src = url;\n document.getElementsByTagName('head')[0].appendChild(scriptEl);\n });\n}\n//# sourceMappingURL=helpers.js.map","import { WebPlugin } from '@capacitor/core';\nimport { assert, loadScript } from './helpers';\n// See https://developers.google.com/identity/gsi/web/guides/use-one-tap-js-api\nexport class GoogleOneTapAuthWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.gsiScriptUrl = 'https://accounts.google.com/gsi/client';\n this.gapiLoadedPromise = undefined;\n this.clientId = undefined;\n this.nonce = undefined;\n }\n async initialize(options) {\n this.clientId = options.clientId;\n this.nonce = options.nonce;\n if (!this.gapiLoadedPromise) {\n this.gapiLoadedPromise = loadScript(this.gsiScriptUrl);\n }\n return this.gapiLoadedPromise;\n }\n async tryAutoOrOneTapSignIn() {\n let signInResult = await this.doSignIn(true);\n if (!signInResult.idToken) {\n signInResult = await this.doSignIn(false);\n }\n if (signInResult.idToken) {\n return {\n isSuccess: true,\n success: signInResult\n };\n }\n else {\n return {\n isSuccess: false,\n noSuccess: signInResult\n };\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n var signInPromise = new Promise((resolve) => {\n this.oneTapInitialize(false, resolve, options.webOptions);\n // // Adding a click_listener allows to detect when the popup is opened.\n // (gsiButtonConfiguration as any).click_listener = () => {\n // console.log('click_listener');\n // };\n google.accounts.id.renderButton(parentElem, gsiButtonConfiguration);\n });\n return signInPromise;\n }\n async doSignIn(autoSelect) {\n var signInPromise = new Promise((resolve, reject) => {\n this.oneTapInitialize(autoSelect, resolve);\n google.accounts.id.prompt((notification) => {\n const developerErrors = ['missing_client_id', 'unregistered_origin'];\n const momentReason = this.getMomentReason(notification);\n if (momentReason !== undefined && developerErrors.includes(momentReason)) {\n reject({ errorCode: momentReason });\n }\n else if (momentReason === 'credential_returned') {\n // Do nothing, handled in handleCredentialResponse.\n }\n else if (notification.isNotDisplayed()\n || notification.isSkippedMoment()\n || notification.isDismissedMoment()) {\n resolve({\n noSuccessReasonCode: momentReason\n });\n }\n });\n });\n return signInPromise;\n }\n getMomentReason(notification) {\n if (notification.isNotDisplayed()) {\n return notification.getNotDisplayedReason();\n }\n if (notification.isSkippedMoment()) {\n return notification.getSkippedReason();\n }\n if (notification.isDismissedMoment()) {\n return notification.getDismissedReason();\n }\n return undefined;\n }\n oneTapInitialize(autoSelect, resolveSignInFunc, webOptions) {\n google.accounts.id.initialize({\n client_id: this.clientId,\n callback: (credentialResponse) => this.handleCredentialResponse(credentialResponse, resolveSignInFunc),\n auto_select: autoSelect,\n itp_support: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.itpSupport) || false,\n cancel_on_tap_outside: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.cancelOnTapOutside) || true,\n ux_mode: (webOptions === null || webOptions === void 0 ? void 0 : webOptions.uxMode) || 'popup',\n nonce: this.nonce,\n use_fedcm_for_prompt: true,\n });\n }\n handleCredentialResponse(credentialResponse, resolveSignInFunc) {\n let signInResult = {\n idToken: credentialResponse.credential,\n selectBy: credentialResponse.select_by,\n };\n resolveSignInFunc(signInResult);\n }\n signOut(authenticatedUserId) {\n return new Promise((resolve) => {\n google.accounts.id.cancel();\n if (authenticatedUserId) {\n // Calling revoke method revokes all OAuth2 scopes previously granted by the Sign In With Google client library.\n google.accounts.id.revoke(authenticatedUserId, response => {\n if (response.successful) {\n resolve({ isSuccess: true });\n }\n else {\n resolve({ isSuccess: false, error: response.error });\n }\n });\n }\n else {\n resolve({ isSuccess: true });\n }\n });\n }\n}\n//# sourceMappingURL=web.js.map","import { Capacitor, registerPlugin } from '@capacitor/core';\nimport { assert, randomHexString } from './helpers';\nimport { GoogleOneTapAuthWeb } from './web';\nimport { jwtDecode } from \"jwt-decode\";\nconst GoogleOneTapAuthPlatform = registerPlugin('GoogleOneTapAuth', {\n web: () => new GoogleOneTapAuthWeb(),\n});\nvar InitializeStatus;\n(function (InitializeStatus) {\n InitializeStatus[InitializeStatus[\"NotInitialized\"] = 0] = \"NotInitialized\";\n InitializeStatus[InitializeStatus[\"Initializing\"] = 1] = \"Initializing\";\n InitializeStatus[InitializeStatus[\"Initialized\"] = 2] = \"Initialized\";\n})(InitializeStatus || (InitializeStatus = {}));\n// This file is the entry point for all plugin methods. It contains common logic to web, android, iOS or delegates to the specific implementation.\nclass GoogleOneTapAuth {\n constructor() {\n this.initializeStatus = InitializeStatus.NotInitialized;\n this.authenticatedUserId = undefined;\n this.isInitializedPromise = new Promise((resolve) => {\n this.resolveIsInitializedPromise = resolve;\n });\n }\n /// Performs common or one-time initialization. Can be called multiple times.\n initialize(options) {\n if (this.initializeStatus === InitializeStatus.NotInitialized) {\n this.initializeStatus = InitializeStatus.Initializing;\n if (!options.clientId || options.clientId.endsWith(\"apps.googleusercontent.com\") == false) {\n throw new Error(\"clientId must end with 'apps.googleusercontent.com' but is: \" + options.clientId);\n }\n this.nonce = options.nonce = options.nonce || randomHexString(10);\n GoogleOneTapAuthPlatform.initialize(options).then(() => {\n this.initializeStatus = InitializeStatus.Initialized;\n this.resolveIsInitializedPromise();\n });\n }\n return this.isInitializedPromise;\n }\n async ensureInitialized() {\n assert(() => this.initializeStatus !== InitializeStatus.NotInitialized, 'Must call initialize first.');\n if (this.initializeStatus === InitializeStatus.Initializing) {\n await this.isInitializedPromise;\n }\n }\n async tryAutoOrOneTapSignIn() {\n await this.ensureInitialized();\n const signInResultOptionPromise = GoogleOneTapAuthPlatform.tryAutoOrOneTapSignIn();\n const notEnrichtedSignInResultOption = (await signInResultOptionPromise);\n const enrichtedSignInResultOption = this.enrichOptionResultWithDecodedIdToken(notEnrichtedSignInResultOption);\n if (enrichtedSignInResultOption.isSuccess) {\n this.authenticatedUserId = enrichtedSignInResultOption.success.userId;\n return {\n successPromise: Promise.resolve(enrichtedSignInResultOption.success),\n noSuccess: new Promise(() => { }),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n else {\n return {\n successPromise: new Promise(() => { }),\n noSuccess: Promise.resolve(enrichtedSignInResultOption.noSuccess),\n signInResultOptionPromise: Promise.resolve(enrichtedSignInResultOption)\n };\n }\n }\n async signOut() {\n const result = await GoogleOneTapAuthPlatform.signOut(this.authenticatedUserId);\n this.authenticatedUserId = undefined;\n return result;\n }\n async addSignInActionToExistingButton(buttonParentId, buttonId) {\n await this.ensureInitialized();\n const buttonParentElem = document.getElementById(buttonParentId);\n const buttonElem = document.getElementById(buttonId);\n assert(() => !!buttonParentElem);\n assert(() => !!buttonElem);\n if (Capacitor.getPlatform() === 'web') {\n buttonParentElem.style.position = 'relative';\n buttonParentElem.style.overflow = 'hidden';\n // buttonParentElem!.style.border = '2px solid red'; // uncomment for debugging\n // The visible button width should be the same as the google button width.\n const buttonElemWidth = buttonElem.offsetWidth;\n assert(() => buttonElemWidth !== 0);\n const invisibleGoogleButtonDiv = document.createElement('div');\n const invisibleGoogleButtonDivId = 'invisibleGoogleButtonDiv';\n invisibleGoogleButtonDiv.setAttribute('id', invisibleGoogleButtonDivId);\n invisibleGoogleButtonDiv.style.position = 'absolute';\n invisibleGoogleButtonDiv.style.top = '0px';\n invisibleGoogleButtonDiv.style.left = '0px';\n invisibleGoogleButtonDiv.style.width = `${buttonElemWidth}px`;\n invisibleGoogleButtonDiv.style.boxSizing = 'border-box';\n invisibleGoogleButtonDiv.style.opacity = '0.0001'; // change it for debugging\n buttonElem.appendChild(invisibleGoogleButtonDiv);\n return await this._doRenderSignInButton(invisibleGoogleButtonDivId, {}, { width: buttonElemWidth }, buttonElem);\n }\n else {\n return await this._doRenderSignInButton(buttonParentId, {}, {}, buttonElem);\n }\n }\n async renderSignInButton(parentElementId, options, gsiButtonConfiguration) {\n const androidAndIosButtonElem = this.getSignInButtonHtml(gsiButtonConfiguration);\n return this._doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem);\n }\n async _doRenderSignInButton(parentElementId, options, gsiButtonConfiguration, androidAndIosButtonElem) {\n await this.ensureInitialized();\n const parentElem = document.getElementById(parentElementId);\n assert(() => !!parentElem);\n options.webOptions = options.webOptions || {};\n return new Promise(async (resolve, reject) => {\n try {\n if (Capacitor.getPlatform() === 'web') {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.renderSignInButton(parentElementId, options, gsiButtonConfiguration);\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n return;\n }\n const onClickAction = async () => {\n var _a;\n try {\n const notEnrichedSuccessSignInResult = await GoogleOneTapAuthPlatform.triggerGoogleSignIn(options);\n if (notEnrichedSuccessSignInResult.isSuccess) {\n const enrichtedSuccessSignInResult = this.enrichSuccessResultWithDecodedIdToken(notEnrichedSuccessSignInResult.success);\n this.authenticatedUserId = enrichtedSuccessSignInResult.userId;\n resolve(enrichtedSuccessSignInResult);\n }\n else {\n if (((_a = notEnrichedSuccessSignInResult.noSuccess) === null || _a === void 0 ? void 0 : _a.noSuccessReasonCode) === 'SIGN_IN_CANCELLED') {\n // console.log('User cancelled sign in. Waiting for next sign in attempt.');\n }\n }\n }\n catch (e) {\n reject(e);\n }\n };\n androidAndIosButtonElem.onclick = onClickAction;\n parentElem.appendChild(androidAndIosButtonElem);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n getNonce() {\n assert(() => !!this.nonce, `The nonce is only set after ${() => this.initialize} was called.`);\n return this.nonce;\n }\n enrichOptionResultWithDecodedIdToken(signInResultOption) {\n if (signInResultOption.isSuccess === false) {\n return signInResultOption;\n }\n return Object.assign(Object.assign({}, signInResultOption), { success: this.enrichSuccessResultWithDecodedIdToken(signInResultOption.success) });\n }\n enrichSuccessResultWithDecodedIdToken(successSignInResult) {\n const decodedJwt = jwtDecode(successSignInResult.idToken);\n return Object.assign(Object.assign({}, successSignInResult), { decodedIdToken: decodedJwt, userId: decodedJwt.sub, email: decodedJwt.email });\n }\n getSignInButtonHtml(gsiButtonConfiguration) {\n var _a;\n // Note: Replacing double quotes with single quotes will break some strings.\n const localizedStrings = {\n en: { signin: 'Sign in', continue_with: 'Continue with Google', signin_with: 'Sign in with Google', signup_with: 'Sign up with Google' },\n ar: { signin: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644', continue_with: '\\u0627\\u0644\\u0645\\u0648\\u0627\\u0635\\u0644\\u0629 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signin_with: '\\u062a\\u0633\\u062c\\u064a\\u0644 \\u0627\\u0644\\u062f\\u062e\\u0648\\u0644 \\u0628\\u0627\\u0633\\u062a\\u062e\\u062f\\u0627\\u0645 Google', signup_with: '\\u0627\\u0644\\u0627\\u0634\\u062a\\u0631\\u0627\\u0643 \\u0645\\u0646 \\u062e\\u0644\\u0627\\u0644 Google' },\n sr: { signin: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438 \\u043c\\u0435', continue_with: '\\u041d\\u0430\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0430 Google-\\u043e\\u043c', signin_with: '\\u041f\\u0440\\u0438\\u0458\\u0430\\u0432\\u0438\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430', signup_with: '\\u0420\\u0435\\u0433\\u0438\\u0441\\u0442\\u0440\\u0443\\u0458\\u0442\\u0435 \\u0441\\u0435 \\u043f\\u043e\\u043c\\u043e\\u045b\\u0443 Google-\\u0430' },\n nb: { signin: 'Logg p\\u00e5', continue_with: 'Fortsett med Google', signin_with: 'Logg p\\u00e5 med Google', signup_with: 'Registrer deg med Google' },\n pl: { signin: 'Zaloguj si\\u0119', continue_with: 'Kontynuuj przy u\\u017cyciu konta Google', signin_with: 'Zaloguj si\\u0119 przez Google', signup_with: 'Zarejestruj si\\u0119 przez Google' },\n vi: { signin: '\\u0110\\u0103ng nh\\u1eadp', continue_with: 'Ti\\u1ebfp t\\u1ee5c truy c\\u1eadp Google', signin_with: '\\u0110\\u0103ng nh\\u00e2\\u0323p b\\u0103\\u0300ng Google', signup_with: '\\u0110\\u0103ng k\\u00fd b\\u1eb1ng Google' },\n cs: { signin: 'P\\u0159ihl\\u00e1sit se', continue_with: 'Pokra\\u010dovat pomoc\\u00ed Googlu', signin_with: \"P\\u0159ihl\\u00e1sit se p\\u0159es Google\", signup_with: 'Registrace pomoc\\u00ed Googlu' },\n id: { signin: 'Login', continue_with: 'Lanjutkan dengan Google', signin_with: 'Login dengan Google', signup_with: 'Daftar dengan Google' },\n nl: { signin: 'Inloggen', continue_with: 'Doorgaan met Google', signin_with: 'Inloggen met Google', signup_with: 'Aanmelden bij Google' },\n gl: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Iniciar sesi\\u00f3n con Google' },\n sv: { signin: 'Logga in', continue_with: 'Forts\\u00e4tt med Google', signin_with: 'Logga in med Google', signup_with: 'Registrera dig med Google' },\n lv: { signin: 'Pierakst\\u012b\\u0161an\\u0101s', continue_with: 'Turpin\\u0101t darbu ar Google', signin_with: 'Pierakstieties ar Google', signup_with: 'Re\\u0123istr\\u0113\\u0161an\\u0101s, izmantojot Google' },\n tr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n it: { signin: 'Accedi', continue_with: 'Continua con Google', signin_with: 'Accedi con Google', signup_with: 'Registrati con Google' },\n sq: { signin: 'Identifikohu', continue_with: 'Vazhdo me Google', signin_with: 'Identifikohu me Google', signup_with: 'Regjistrohu me Google' },\n ro: { signin: 'Conecteaz\\u0103-te', continue_with: 'Continu\\u0103 cu Google', signin_with: 'Conecteaz\\u0103-te cu Google', signup_with: '\\u00censcrie-te cu Google' },\n de: { signin: 'Anmelden', continue_with: 'Weiter mit Google', signin_with: '\\u00dcber Google anmelden', signup_with: 'Mit Google anmelden' },\n ko: { signin: '\\ub85c\\uadf8\\uc778', continue_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uacc4\\uc18d\\ud558\\uae30', signin_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\ub85c\\uadf8\\uc778', signup_with: 'Google \\uacc4\\uc815\\uc73c\\ub85c \\uac00\\uc785\\ud558\\uae30' },\n fr: { signin: 'Se connecter', continue_with: 'Continuer avec Google', signin_with: 'Se connecter avec Google', signup_with: \"S'inscrire avec Google\" },\n kmr: { signin: 'Oturum a\\u00e7\\u0131n', continue_with: 'Google ile devam edin', signin_with: 'Google ile oturum a\\u00e7\\u0131n', signup_with: 'Google ile kaydolun' },\n zh: { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-CN': { signin: '\\u767b\\u5f55', continue_with: '\\u901a\\u8fc7 Google \\u7ee7\\u7eed\\u64cd\\u4f5c', signin_with: \"\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u767b\\u5f55\", signup_with: '\\u4f7f\\u7528 Google \\u5e10\\u53f7\\u6ce8\\u518c' },\n 'zh-HK': { signin: '\\u767b\\u5165', continue_with: '\\u7e7c\\u7e8c\\u900f\\u904e Google \\u5e33\\u6236\\u64cd\\u4f5c', signin_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u767b\\u5165', signup_with: '\\u4f7f\\u7528 Google \\u5e33\\u6236\\u8a3b\\u518a' },\n pt: { signin: 'Fazer login', continue_with: 'Continuar com o Google', signin_with: 'Fazer login com o Google', signup_with: 'Inscrever-se no Google' },\n es: { signin: 'Iniciar sesi\\u00f3n', continue_with: 'Continuar con Google', signin_with: 'Iniciar sesi\\u00f3n con Google', signup_with: 'Registrarse con Google' },\n };\n const locale = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.locale;\n let localeTexts = locale !== undefined && locale in localizedStrings ? (localizedStrings[locale]) : undefined;\n if (localeTexts === undefined) {\n const countryCode = (locale === null || locale === void 0 ? void 0 : locale.includes('-')) === true ? locale.split('-')[1] : (locale !== null && locale !== void 0 ? locale : '');\n localeTexts = countryCode in localizedStrings ? localizedStrings[countryCode] : localizedStrings['en'];\n }\n const text = (_a = gsiButtonConfiguration === null || gsiButtonConfiguration === void 0 ? void 0 : gsiButtonConfiguration.text) !== null && _a !== void 0 ? _a : 'signin_with';\n const buttonText = localeTexts[text];\n // HTML from https://github.com/inouiw/ReactSignInWithGoogleButton\n const button = document.createElement('button');\n button.setAttribute(\"style\", \"border-radius: 4px; background-color: rgb(255, 255, 255); border: 1px solid rgb(218, 220, 224); color: rgb(60, 64, 67); cursor: pointer; font-family: Roboto, Verdana; font-weight: 500; font-size: 14px; height: 40px; letter-spacing: 0.25px; padding: 0px 12px; position: relative; text-align: center; vertical-align: middle; width: auto;\");\n button.innerHTML = `\n <div style=\"display: flex; align-items: center; flex-flow: row nowrap; justify-content: space-between; height: 100%; position: relative; width: 100%;\">\n <div style=\"height: 18px; margin-right: 8px; min-width: 18px; width: 18px;\">\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" width=\"18px\" height=\"18px\" viewBox=\"0 0 48 48\">\n <g>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\"></path>\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\"></path>\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\"></path>\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\"></path>\n <path fill=\"none\" d=\"M0 0h48v48H0z\"></path>\n </g>\n </svg>\n </div>\n <p>${buttonText}</p>\n </div>`;\n return button;\n }\n}\nconst googleOneTapAuth = new GoogleOneTapAuth();\nexport { googleOneTapAuth as GoogleOneTapAuth };\n//# sourceMappingURL=GoogleOneTapAuth.js.map"],"names":["WebPlugin","registerPlugin","Capacitor","jwtDecode"],"mappings":";;;I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presentingVc) { signInResult, error in
|
|
40
40
|
if let error = error {
|
|
41
41
|
if (error._code == self.gIDSignInErrorCodeCanceled) {
|
|
42
|
-
call.resolve(self.createErrorResponse(reasonCode: "SIGN_IN_CANCELLED"))
|
|
42
|
+
call.resolve(self.wrapInSignInResultInOption(self.createErrorResponse(reasonCode: "SIGN_IN_CANCELLED")))
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
call.reject(error.localizedDescription, "\(error._code)")
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
call.resolve(self.createSuccessSignInResult(user: signInResult?.user))
|
|
48
|
+
call.resolve(self.wrapInSignInResultInOption(self.createSuccessSignInResult(user: signInResult?.user)))
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-native-google-one-tap-signin",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "Google One Tap sign-in plugin for capacitor.",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
48
48
|
"swiftlint": "node-swiftlint",
|
|
49
49
|
"docgen": "docgen --api GoogleOneTapAuthPlugin --output-readme README.md --output-json dist/docs.json",
|
|
50
|
-
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
51
|
-
"buildall": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.
|
|
50
|
+
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
|
|
51
|
+
"buildall": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs && (cd ./demo/react && npm install && npm run build && npx cap sync --inline && cd -)",
|
|
52
52
|
"clean": "rimraf ./dist",
|
|
53
53
|
"watch": "tsc --watch",
|
|
54
54
|
"prepublishOnly": "npm run build"
|
|
@@ -60,18 +60,18 @@
|
|
|
60
60
|
"@capacitor/docgen": "^0.2.1",
|
|
61
61
|
"@capacitor/ios": "^5.0.0",
|
|
62
62
|
"@ionic/eslint-config": "^0.3.0",
|
|
63
|
-
"@ionic/prettier-config": "^
|
|
63
|
+
"@ionic/prettier-config": "^4.0.0",
|
|
64
64
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
65
|
-
"@types/gapi": "^0.0.
|
|
66
|
-
"@types/gapi.auth2": "^0.0.
|
|
67
|
-
"@types/google-one-tap": "^1.2.
|
|
68
|
-
"eslint": "^7.
|
|
69
|
-
"prettier": "^
|
|
65
|
+
"@types/gapi": "^0.0.47",
|
|
66
|
+
"@types/gapi.auth2": "^0.0.60",
|
|
67
|
+
"@types/google-one-tap": "^1.2.5",
|
|
68
|
+
"eslint": "^7.0.0",
|
|
69
|
+
"prettier": "^3.1.0",
|
|
70
70
|
"prettier-plugin-java": "^2.0.0",
|
|
71
|
-
"rimraf": "^
|
|
72
|
-
"rollup": "^
|
|
71
|
+
"rimraf": "^5.0.5",
|
|
72
|
+
"rollup": "^4.4.0",
|
|
73
73
|
"swiftlint": "^1.0.1",
|
|
74
|
-
"typescript": "^5.
|
|
74
|
+
"typescript": "^5.2.2"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"@capacitor/core": "^5.0.0"
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"jwt-decode": "^
|
|
93
|
+
"jwt-decode": "^4.0.0"
|
|
94
94
|
}
|
|
95
95
|
}
|