Clean up LoginWithGoogle.cs
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Hutopy.Web.Common;
|
|
||||||
using Hutopy.Web.Common.Security;
|
using Hutopy.Web.Common.Security;
|
||||||
using Microsoft.AspNetCore.Identity;
|
using Microsoft.AspNetCore.Identity;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
@@ -32,6 +31,7 @@ public class GoogleUserInfo
|
|||||||
public record LoginWithGoogleRequest(
|
public record LoginWithGoogleRequest(
|
||||||
string Token);
|
string Token);
|
||||||
|
|
||||||
|
[PublicAPI]
|
||||||
public record LoginWithGoogleResponse(
|
public record LoginWithGoogleResponse(
|
||||||
string AccessToken,
|
string AccessToken,
|
||||||
string RefreshToken);
|
string RefreshToken);
|
||||||
@@ -59,7 +59,7 @@ public class LoginWithGoogleHandler(
|
|||||||
|
|
||||||
// Verify the token with Google
|
// Verify the token with Google
|
||||||
using var httpClient = httpClientFactory.CreateClient();
|
using var httpClient = httpClientFactory.CreateClient();
|
||||||
var response = await httpClient.GetAsync(
|
using var response = await httpClient.GetAsync(
|
||||||
$"https://www.googleapis.com/oauth2/v1/userinfo?access_token={googleToken.AccessToken}",
|
$"https://www.googleapis.com/oauth2/v1/userinfo?access_token={googleToken.AccessToken}",
|
||||||
ct);
|
ct);
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
|
|||||||
Reference in New Issue
Block a user