[backend/razor] Add feature flags toggles to /oauth/authorize
This commit is contained in:
parent
4a2ee992c2
commit
c471070162
3 changed files with 40 additions and 21 deletions
|
@ -17,16 +17,26 @@
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
Log in below to confirm this:
|
|
||||||
|
|
||||||
<div class="form-wrapper">
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
|
<div class="margin-bottom-5px">
|
||||||
|
Feature flags:
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" name="supportsHtmlFormatting" id="supportsHtmlFormatting" value="1"/>
|
||||||
|
<label for="supportsHtmlFormatting">This app supports HTML formatting</label>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="checkbox" name="autoDetectQuotes" id="autoDetectQuotes" value="1"/>
|
||||||
|
<label for="autoDetectQuotes">Automatically detect quotes</label>
|
||||||
|
</div>
|
||||||
|
<div class="margin-bottom-5px margin-top-10px">
|
||||||
|
Log in below to confirm this:
|
||||||
|
</div>
|
||||||
<input type="text" placeholder="Username" name="username"/>
|
<input type="text" placeholder="Username" name="username"/>
|
||||||
<input type="password" placeholder="Password" name="password"/>
|
<input type="password" placeholder="Password" name="password"/>
|
||||||
<button type="submit">Submit</button>
|
<button type="submit">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
else if (Model.Token.RedirectUri == "urn:ietf:wg:oauth:2.0:oob")
|
else if (Model.Token.RedirectUri == "urn:ietf:wg:oauth:2.0:oob")
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,10 @@ public class AuthorizeModel(DatabaseContext db) : PageModel
|
||||||
throw GracefulException.BadRequest("Cannot request redirect_uri not sent during app registration");
|
throw GracefulException.BadRequest("Cannot request redirect_uri not sent during app registration");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OnPost([FromForm] string username, [FromForm] string password)
|
public async Task OnPost(
|
||||||
|
[FromForm] string username, [FromForm] string password, [FromForm] bool supportsHtmlFormatting,
|
||||||
|
[FromForm] bool autoDetectQuotes
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Validate query parameters first
|
// Validate query parameters first
|
||||||
await OnGet();
|
await OnGet();
|
||||||
|
@ -68,7 +71,9 @@ public class AuthorizeModel(DatabaseContext db) : PageModel
|
||||||
User = user,
|
User = user,
|
||||||
CreatedAt = DateTime.UtcNow,
|
CreatedAt = DateTime.UtcNow,
|
||||||
Scopes = Scopes,
|
Scopes = Scopes,
|
||||||
RedirectUri = RedirectUri
|
RedirectUri = RedirectUri,
|
||||||
|
AutoDetectQuotes = autoDetectQuotes,
|
||||||
|
SupportsHtmlFormatting = supportsHtmlFormatting
|
||||||
};
|
};
|
||||||
|
|
||||||
await db.AddAsync(token);
|
await db.AddAsync(token);
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
color: #9a92ff;
|
color: #9a92ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-wrapper {
|
.margin-bottom-5px {
|
||||||
padding-top: 5px;
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.margin-top-10px {
|
||||||
|
margin-top: 10px;
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue