[backend/masto-client] Rename VerifyCredentials to VerifyAppCredentials

This commit is contained in:
Laura Hausmann 2024-01-31 22:23:25 +01:00
parent d255de0dd0
commit 16316b81ff
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 4 additions and 4 deletions

View file

@ -18,13 +18,13 @@ public class MastodonAuthController(DatabaseContext db) : Controller {
[HttpGet("/api/v1/apps/verify_credentials")] [HttpGet("/api/v1/apps/verify_credentials")]
[AuthenticateOauth] [AuthenticateOauth]
[Produces("application/json")] [Produces("application/json")]
[ProducesResponseType(StatusCodes.Status200OK, Type = typeof(MastodonAuth.VerifyCredentialsResponse))] [ProducesResponseType(StatusCodes.Status200OK, Type = typeof(MastodonAuth.VerifyAppCredentialsResponse))]
[ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))] [ProducesResponseType(StatusCodes.Status401Unauthorized, Type = typeof(MastodonErrorResponse))]
public IActionResult VerifyCredentials() { public IActionResult VerifyAppCredentials() {
var token = HttpContext.GetOauthToken(); var token = HttpContext.GetOauthToken();
if (token == null) throw GracefulException.Unauthorized("The access token is invalid"); if (token == null) throw GracefulException.Unauthorized("The access token is invalid");
var res = new MastodonAuth.VerifyCredentialsResponse { var res = new MastodonAuth.VerifyAppCredentialsResponse {
App = token.App, App = token.App,
VapidKey = null //FIXME VapidKey = null //FIXME
}; };

View file

@ -8,7 +8,7 @@ using B = Microsoft.AspNetCore.Mvc.BindPropertyAttribute;
namespace Iceshrimp.Backend.Controllers.Mastodon.Schemas; namespace Iceshrimp.Backend.Controllers.Mastodon.Schemas;
public abstract class MastodonAuth { public abstract class MastodonAuth {
public class VerifyCredentialsResponse { public class VerifyAppCredentialsResponse {
public required OauthApp App; public required OauthApp App;
[J("name")] public string Name => App.Name; [J("name")] public string Name => App.Name;