chore(backend): silence some more resharper errors
This commit is contained in:
		
							parent
							
								
									103ba24555
								
							
						
					
					
						commit
						2cef7523d2
					
				
					 14 changed files with 38 additions and 35 deletions
				
			
		|  | @ -74,6 +74,7 @@ public class AuthService(IClock clock, DatabaseContext db, ISnowflakeGenerator s | |||
|     /// </summary> | ||||
|     /// <param name="email">The user's email address</param> | ||||
|     /// <param name="password">The user's password, in plain text</param> | ||||
|     /// <param name="ct">Cancellation token</param> | ||||
|     /// <returns>A tuple of the authenticated user and whether multi-factor authentication is required</returns> | ||||
|     /// <exception cref="ApiError.NotFound">Thrown if the email address is not associated with any user | ||||
|     /// or if the password is incorrect</exception> | ||||
|  |  | |||
|  | @ -1,6 +1,5 @@ | |||
| using Foxnouns.Backend.Database; | ||||
| using Foxnouns.Backend.Database.Models; | ||||
| using Foxnouns.Backend.Utils; | ||||
| using Microsoft.EntityFrameworkCore; | ||||
| using Newtonsoft.Json; | ||||
| using NodaTime; | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| using System.Diagnostics.CodeAnalysis; | ||||
| using System.Web; | ||||
| using JetBrains.Annotations; | ||||
| 
 | ||||
| namespace Foxnouns.Backend.Services; | ||||
| 
 | ||||
|  | @ -27,10 +27,11 @@ public class RemoteAuthService(Config config, ILogger logger) | |||
|         if (!resp.IsSuccessStatusCode) | ||||
|         { | ||||
|             var respBody = await resp.Content.ReadAsStringAsync(ct); | ||||
|             _logger.Error("Received error status {StatusCode} when exchanging OAuth token: {ErrorBody}", (int)resp.StatusCode, respBody); | ||||
|             _logger.Error("Received error status {StatusCode} when exchanging OAuth token: {ErrorBody}", | ||||
|                 (int)resp.StatusCode, respBody); | ||||
|             throw new FoxnounsError("Invalid Discord OAuth response"); | ||||
|         } | ||||
|          | ||||
| 
 | ||||
|         resp.EnsureSuccessStatusCode(); | ||||
|         var token = await resp.Content.ReadFromJsonAsync<DiscordTokenResponse>(ct); | ||||
|         if (token == null) throw new FoxnounsError("Discord token response was null"); | ||||
|  | @ -46,10 +47,14 @@ public class RemoteAuthService(Config config, ILogger logger) | |||
|         return new RemoteUser(user.id, user.username); | ||||
|     } | ||||
| 
 | ||||
|     [SuppressMessage("ReSharper", "InconsistentNaming")] | ||||
|     [SuppressMessage("ReSharper", "InconsistentNaming", | ||||
|         Justification = "Easier to use snake_case here, rather than passing in JSON converter options")] | ||||
|     [UsedImplicitly] | ||||
|     private record DiscordTokenResponse(string access_token, string token_type); | ||||
| 
 | ||||
|     [SuppressMessage("ReSharper", "InconsistentNaming")] | ||||
|     [SuppressMessage("ReSharper", "InconsistentNaming", | ||||
|         Justification = "Easier to use snake_case here, rather than passing in JSON converter options")] | ||||
|     [UsedImplicitly] | ||||
|     private record DiscordUserResponse(string id, string username); | ||||
| 
 | ||||
|     public record RemoteUser(string Id, string Username); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue