From 9c8debb5ed1a39c26d2cc7d897b5720ebd4fadf5 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Fri, 12 Jul 2024 17:48:54 +0200 Subject: [PATCH] [backend/masto-client] Improve error message when requesting an oauth token with a grant_type other than authorization_code --- Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs b/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs index a43b8164..4b2d6d9c 100644 --- a/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs +++ b/Iceshrimp.Backend/Controllers/Mastodon/AuthController.cs @@ -89,7 +89,7 @@ public class AuthController(DatabaseContext db, MetaService meta) : ControllerBa { //TODO: app-level access (grant_type = "client_credentials") if (request.GrantType != "authorization_code") - throw GracefulException.BadRequest("Invalid grant_type"); + throw GracefulException.BadRequest($"Invalid grant_type, only authorization_code is supported."); var token = await db.OauthTokens.FirstOrDefaultAsync(p => p.Code == request.Code && p.App.ClientId == request.ClientId && p.App.ClientSecret == request.ClientSecret);