[backend/masto-client] Rename VerifyCredentials to VerifyAppCredentials
This commit is contained in:
parent
d255de0dd0
commit
16316b81ff
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
};
|
};
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue