From 01437e2c6e47e0f767756c8f3a11460d98312554 Mon Sep 17 00:00:00 2001 From: Karsten Jeppesen Date: Fri, 23 Oct 2026 07:25:11 +0200 Subject: [PATCH] Authentication active --- VagrantBoxUploader/VagrantBoxUploader/Models/UploadViewMod.cs | 2 +- VagrantBoxUploader/VagrantBoxUploader/Pages/Index.cshtml.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VagrantBoxUploader/VagrantBoxUploader/Models/UploadViewMod.cs b/VagrantBoxUploader/VagrantBoxUploader/Models/UploadViewMod.cs index 8895e0b..18775a9 100644 --- a/VagrantBoxUploader/VagrantBoxUploader/Models/UploadViewMod.cs +++ b/VagrantBoxUploader/VagrantBoxUploader/Models/UploadViewMod.cs @@ -13,7 +13,7 @@ namespace VagrantBoxUploader.Models public string BaseUri { get; set; } = string.Empty; [Required] - [Display(Name = "Gitea user name")] + [Display(Name = "Gitea Organization name")] public string Username { get; set; } = string.Empty; [Required] diff --git a/VagrantBoxUploader/VagrantBoxUploader/Pages/Index.cshtml.cs b/VagrantBoxUploader/VagrantBoxUploader/Pages/Index.cshtml.cs index 7528f95..706d972 100644 --- a/VagrantBoxUploader/VagrantBoxUploader/Pages/Index.cshtml.cs +++ b/VagrantBoxUploader/VagrantBoxUploader/Pages/Index.cshtml.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using VagrantBoxUploader.Models; @@ -5,6 +6,7 @@ using VagrantBoxUploader.Services; namespace VagrantBoxUploader.Pages; + public class IndexModel : PageModel { private readonly GiteaPackageService _giteaService; @@ -25,6 +27,7 @@ public class IndexModel : PageModel public bool UploadSucceeded { get; set; } + [Authorize] public void OnGet() { Upload.BaseUri = @@ -34,6 +37,7 @@ public class IndexModel : PageModel Upload.Provider = "virtualbox"; } + [Authorize] public async Task OnPostAsync( CancellationToken cancellationToken) {