@capgo/capacitor-social-login 8.2.21 → 8.2.23
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 +74 -0
- package/android/build.gradle +2 -1
- package/android/src/main/java/ee/forgr/capacitor/social/login/SocialLoginPlugin.java +93 -1
- package/dist/docs.json +70 -0
- package/dist/esm/definitions.d.ts +66 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +33 -0
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +33 -0
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +33 -0
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/SocialLoginPlugin/SocialLoginPlugin.swift +64 -2
- package/package.json +3 -2
package/dist/plugin.js
CHANGED
|
@@ -1968,6 +1968,39 @@ var capacitorCapacitorUpdater = (function (exports, core) {
|
|
|
1968
1968
|
async getPluginVersion() {
|
|
1969
1969
|
return { version: 'web' };
|
|
1970
1970
|
}
|
|
1971
|
+
async openSecureWindow(options) {
|
|
1972
|
+
const w = 600;
|
|
1973
|
+
const h = 550;
|
|
1974
|
+
const settings = [
|
|
1975
|
+
['width', w],
|
|
1976
|
+
['height', h],
|
|
1977
|
+
['left', screen.width / 2 - w / 2],
|
|
1978
|
+
['top', screen.height / 2 - h / 2],
|
|
1979
|
+
]
|
|
1980
|
+
.map((x) => x.join('='))
|
|
1981
|
+
.join(',');
|
|
1982
|
+
const popup = window.open(options.authEndpoint, 'Authorization', settings);
|
|
1983
|
+
if (typeof popup.focus === 'function') {
|
|
1984
|
+
popup.focus();
|
|
1985
|
+
}
|
|
1986
|
+
return new Promise((resolve, reject) => {
|
|
1987
|
+
const bc = new BroadcastChannel(options.broadcastChannelName || 'oauth-channel');
|
|
1988
|
+
bc.addEventListener('message', (event) => {
|
|
1989
|
+
if (event.data.startsWith(options.redirectUri)) {
|
|
1990
|
+
bc.close();
|
|
1991
|
+
resolve({ redirectedUri: event.data });
|
|
1992
|
+
}
|
|
1993
|
+
else {
|
|
1994
|
+
bc.close();
|
|
1995
|
+
reject(new Error('Redirect URI does not match, expected ' + options.redirectUri + ' but got ' + event.data));
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1998
|
+
setTimeout(() => {
|
|
1999
|
+
bc.close();
|
|
2000
|
+
reject(new Error('The sign-in flow timed out'));
|
|
2001
|
+
}, 5 * 60000);
|
|
2002
|
+
});
|
|
2003
|
+
}
|
|
1971
2004
|
}
|
|
1972
2005
|
SocialLoginWeb.OAUTH_STATE_KEY = 'social_login_oauth_pending';
|
|
1973
2006
|
|