Skip to content

Commit

Permalink
returning failure when ktisu auth fails
Browse files Browse the repository at this point in the history
  • Loading branch information
vosmiic committed Jun 10, 2024
1 parent d8292bc commit 50dc8e4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Api/AniSyncController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public async Task<IActionResult> PasswordGrantAuthentication(ApiName provider, s
if (userConfig != null) {
KitsuApiCalls kitsuApiCalls = new KitsuApiCalls(_httpClientFactory, _loggerFactory, _serverApplicationHost, _httpContextAccessor, _memoryCache, _delayer, userConfig);
var kitsuUserConfig = await kitsuApiCalls.GetUserInformation();
if (kitsuUserConfig == null)
return StatusCode(500, "Could not authenticate");
var existingKeyPair = userConfig.KeyPairs.FirstOrDefault(item => item.Key == "KitsuUserId");
if (existingKeyPair != null) {
existingKeyPair.Value = kitsuUserConfig.Id.ToString();
Expand Down

0 comments on commit 50dc8e4

Please sign in to comment.