after refactor cleanup
This commit is contained in:
30
DiunaBI.UI.Shared/Services/WebGoogleAuthService.cs
Normal file
30
DiunaBI.UI.Shared/Services/WebGoogleAuthService.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Microsoft.JSInterop;
|
||||
|
||||
namespace DiunaBI.UI.Shared.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Web implementation of Google authentication using JavaScript SDK
|
||||
/// </summary>
|
||||
public class WebGoogleAuthService : IGoogleAuthService
|
||||
{
|
||||
private readonly IJSRuntime _jsRuntime;
|
||||
|
||||
public WebGoogleAuthService(IJSRuntime jsRuntime)
|
||||
{
|
||||
_jsRuntime = jsRuntime;
|
||||
}
|
||||
|
||||
public async Task<bool> SignInAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
await _jsRuntime.InvokeVoidAsync("requestGoogleSignIn");
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"❌ Web Google Sign-In error: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user