[backend/masto-client] Fix /oauth/token
This commit is contained in:
parent
c293a0bd3c
commit
d255de0dd0
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ public class MastodonAuthController(DatabaseContext db) : Controller {
|
|||
[ProducesResponseType(StatusCodes.Status400BadRequest, Type = typeof(MastodonErrorResponse))]
|
||||
public async Task<IActionResult> GetOauthToken([FromHybrid] MastodonAuth.OauthTokenRequest request) {
|
||||
//TODO: app-level access (grant_type = "client_credentials")
|
||||
if (request.GrantType != "code")
|
||||
if (request.GrantType != "authorization_code")
|
||||
throw GracefulException.BadRequest("Invalid grant_type");
|
||||
var token = await db.OauthTokens.FirstOrDefaultAsync(p => p.Code == request.Code &&
|
||||
p.App.ClientId == request.ClientId &&
|
||||
|
|
Loading…
Add table
Reference in a new issue