aboutsummaryrefslogtreecommitdiff
path: root/VNLib.Plugins.Essentials.SocialOauth/Endpoints
diff options
context:
space:
mode:
authorLibravatar vman <public@vaughnnugent.com>2022-11-30 14:59:18 -0500
committerLibravatar vman <public@vaughnnugent.com>2022-11-30 14:59:18 -0500
commitf13193aa928f099c8152653570d2839b46b8f1ee (patch)
treebe2394edec528472258c0da7d354bbb8ad9881e4 /VNLib.Plugins.Essentials.SocialOauth/Endpoints
parente4ce3ae25802471bea0ea99698fbb3f6ffdf7953 (diff)
Project cleanup + analyzer updates
Diffstat (limited to 'VNLib.Plugins.Essentials.SocialOauth/Endpoints')
-rw-r--r--VNLib.Plugins.Essentials.SocialOauth/Endpoints/GitHubOauth.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/VNLib.Plugins.Essentials.SocialOauth/Endpoints/GitHubOauth.cs b/VNLib.Plugins.Essentials.SocialOauth/Endpoints/GitHubOauth.cs
index 78b4b49..0b4fc0f 100644
--- a/VNLib.Plugins.Essentials.SocialOauth/Endpoints/GitHubOauth.cs
+++ b/VNLib.Plugins.Essentials.SocialOauth/Endpoints/GitHubOauth.cs
@@ -140,7 +140,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth.Endpoints
if (!profResponse.IsSuccessful || profResponse.Data == null || profResponse.Data.ID < 100)
{
- Log.Debug("Client attempted a github login but GH responded with status code {code}", profResponse.StatusCode);
+ Log.Debug("Github login data attempt responded with status code {code}", profResponse.StatusCode);
return null;
}
@@ -173,9 +173,11 @@ namespace VNLib.Plugins.Essentials.SocialOauth.Endpoints
//Capture the first primary email address and make sure its verified
if (email.Primary && email.Verified)
{
- accountData ??= new();
- //store email on current profile
- accountData.EmailAddress = email.Email;
+ accountData = new()
+ {
+ //store email on current profile
+ EmailAddress = email.Email
+ };
goto Continue;
}
}
@@ -184,7 +186,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth.Endpoints
}
else
{
- Log.Debug("Client attempted a github login but GH responded with status code {code}", getEmailResponse.StatusCode);
+ Log.Debug("Github account data request failed but GH responded with status code {code}", getEmailResponse.StatusCode);
return null;
}
Continue:
@@ -196,7 +198,7 @@ namespace VNLib.Plugins.Essentials.SocialOauth.Endpoints
RestResponse<GithubProfile> profResponse = await client.Resource.ExecuteAsync<GithubProfile>(request, cancellationToken);
if (!profResponse.IsSuccessful || profResponse.Data == null)
{
- Log.Debug("Client attempted a github login but GH responded with status code {code}", profResponse.StatusCode);
+ Log.Debug("Github account data request failed but GH responded with status code {code}", profResponse.StatusCode);
return null;
}