auth fix
This commit is contained in:
@@ -52,8 +52,11 @@
|
|||||||
{
|
{
|
||||||
_instance = this;
|
_instance = this;
|
||||||
|
|
||||||
// Only initialize JavaScript Google SDK if we're NOT using platform-specific auth (i.e., web)
|
// Initialize JavaScript Google SDK for web (both null service and WebGoogleAuthService)
|
||||||
if (GoogleAuthService == null)
|
// Skip only for mobile platform-specific auth (MobileGoogleAuthService)
|
||||||
|
var isMobileAuth = GoogleAuthService != null && GoogleAuthService.GetType().Name == "MobileGoogleAuthService";
|
||||||
|
|
||||||
|
if (!isMobileAuth)
|
||||||
{
|
{
|
||||||
await InitializeGoogleSignIn();
|
await InitializeGoogleSignIn();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ window.initGoogleSignIn = function(clientId) {
|
|||||||
throw new Error("Google Sign-In library not ready");
|
throw new Error("Google Sign-In library not ready");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Używamy google.accounts.id - zwraca ID token (JWT credential)
|
|
||||||
google.accounts.id.initialize({
|
google.accounts.id.initialize({
|
||||||
client_id: clientId,
|
client_id: clientId,
|
||||||
callback: handleCredentialResponse,
|
callback: handleCredentialResponse,
|
||||||
@@ -37,7 +36,6 @@ window.initGoogleSignIn = function(clientId) {
|
|||||||
window.requestGoogleSignIn = function() {
|
window.requestGoogleSignIn = function() {
|
||||||
console.log("🚀 Requesting Google Sign-In...");
|
console.log("🚀 Requesting Google Sign-In...");
|
||||||
|
|
||||||
// Pokaż One Tap prompt (without deprecated notification callbacks for FedCM compatibility)
|
|
||||||
google.accounts.id.prompt();
|
google.accounts.id.prompt();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user