clean up RemoteAuthService

This commit is contained in:
sam 2024-12-10 14:09:32 +01:00
parent 3338243cea
commit 80b7f192f1
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
4 changed files with 17 additions and 25 deletions

View file

@ -13,6 +13,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using System.Web;
using Foxnouns.Backend.Database;
using Foxnouns.Backend.Database.Models;
@ -35,6 +36,12 @@ public partial class RemoteAuthService(
public record RemoteUser(string Id, string Username);
[SuppressMessage("ReSharper", "ClassNeverInstantiated.Local")]
private record OauthTokenResponse(
[property: JsonPropertyName("access_token")] string AccessToken,
[property: JsonPropertyName("token_type")] string TokenType
);
/// <summary>
/// Validates whether a user can still add a new account of the given AuthType, and throws an error if they can't.
/// </summary>