[backend/masto-client] Fix /oauth/authorize when client id contains pluses
This commit is contained in:
parent
8a64511f3a
commit
c293a0bd3c
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ public class AuthorizeModel(DatabaseContext db) : PageModel {
|
||||||
public OauthToken? Token = null;
|
public OauthToken? Token = null;
|
||||||
|
|
||||||
public async Task OnGet() {
|
public async Task OnGet() {
|
||||||
App = await db.OauthApps.FirstOrDefaultAsync(p => p.ClientId == ClientId)
|
App = await db.OauthApps.FirstOrDefaultAsync(p => p.ClientId == ClientId.Replace(' ', '+'))
|
||||||
?? throw GracefulException.BadRequest("Invalid client_id");
|
?? throw GracefulException.BadRequest("Invalid client_id");
|
||||||
if (MastodonOauthHelpers.ExpandScopes(Scopes).Except(MastodonOauthHelpers.ExpandScopes(App.Scopes)).Any())
|
if (MastodonOauthHelpers.ExpandScopes(Scopes).Except(MastodonOauthHelpers.ExpandScopes(App.Scopes)).Any())
|
||||||
throw GracefulException.BadRequest("Cannot request more scopes than app");
|
throw GracefulException.BadRequest("Cannot request more scopes than app");
|
||||||
|
|
Loading…
Add table
Reference in a new issue