added Microser
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// Copyright (c) Duende Software. All rights reserved.
|
||||
// See LICENSE in the project root for license information.
|
||||
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace Microser.IdS.Pages.Admin.ApiScopes
|
||||
{
|
||||
[SecurityHeaders]
|
||||
[Authorize]
|
||||
public class NewModel : PageModel
|
||||
{
|
||||
private readonly ApiScopeRepository _repository;
|
||||
|
||||
public NewModel(ApiScopeRepository repository)
|
||||
{
|
||||
_repository = repository;
|
||||
}
|
||||
|
||||
[BindProperty]
|
||||
public ApiScopeModel InputModel { get; set; } = default!;
|
||||
|
||||
public void OnGet()
|
||||
{
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostAsync()
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
await _repository.CreateAsync(InputModel);
|
||||
return RedirectToPage("/Admin/ApiScopes/Edit", new { id = InputModel.Name });
|
||||
}
|
||||
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user