Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
612 changes: 612 additions & 0 deletions .editorconfig

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.formatOnSave": true,
"dotnet.formatting.organizeImportsOnFormat": true,
"editor.codeActionsOnSave": {
"source.removeUnusedImports": "explicit",
"source.organizeImports": "explicit"
},
"files.trimTrailingWhitespace": true,
"files.associations": {
"*.*proj": "xml",
"*.props": "xml",
"*.targets": "xml",
"*.tasks": "xml"
},
"dotnet.preferCSharpExtension": true
}
18 changes: 16 additions & 2 deletions src/Areas/Identity/Pages/Account/AccessDenied.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using Microsoft.AspNetCore.Mvc.RazorPages;
Expand Down
24 changes: 17 additions & 7 deletions src/Areas/Identity/Pages/Account/ConfirmEmail.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down
23 changes: 17 additions & 6 deletions src/Areas/Identity/Pages/Account/ConfirmEmailChange.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.Text;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down
27 changes: 18 additions & 9 deletions src/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.ComponentModel.DataAnnotations;
using System.Security.Claims;
using System.Text;
using System.Text.Encodings.Web;
using System.Threading;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Logging;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down Expand Up @@ -86,7 +95,7 @@ public class InputModel
[EmailAddress]
public string Email { get; set; }
}

public IActionResult OnGet() => RedirectToPage("./Login");

public IActionResult OnPost(string provider, string returnUrl = null)
Expand Down
32 changes: 20 additions & 12 deletions src/Areas/Identity/Pages/Account/ForgotPassword.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.Encodings.Web;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down Expand Up @@ -50,9 +58,9 @@ public class InputModel
public string Email { get; set; }
}

public async Task<IActionResult> OnPostAsync()
public Task<IActionResult> OnPostAsync()
{
return NotFound();
return Task.FromResult<IActionResult>(NotFound());

//if (ModelState.IsValid)
//{
Expand Down Expand Up @@ -84,4 +92,4 @@ public async Task<IActionResult> OnPostAsync()
//return Page();
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using Microsoft.AspNetCore.Authorization;
Expand Down
18 changes: 16 additions & 2 deletions src/Areas/Identity/Pages/Account/Lockout.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using Microsoft.AspNetCore.Authorization;
Expand Down
37 changes: 22 additions & 15 deletions src/Areas/Identity/Pages/Account/Login.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.UI.Services;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down Expand Up @@ -87,13 +94,13 @@ public class InputModel
public async Task<IActionResult> OnGetAsync(string returnUrl = null)
{
//If there are no ApplicationUsers in the db, redirect to SetupSuperadmin page to create the new superadmin
if (! _signInManager.UserManager.Users.Any())

if (!_signInManager.UserManager.Users.Any())
{
return RedirectToPage("./SetupSuperadmin");
}


if (!string.IsNullOrEmpty(ErrorMessage))
{
ModelState.AddModelError(string.Empty, ErrorMessage);
Expand Down Expand Up @@ -150,4 +157,4 @@ public async Task<IActionResult> OnPostAsync(string returnUrl = null)
return Page();
}
}
}
}
22 changes: 18 additions & 4 deletions src/Areas/Identity/Pages/Account/LoginWith2fa.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System.ComponentModel.DataAnnotations;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Identity;
using NodeGuard.Data.Models;

namespace NodeGuard.Areas.Identity.Pages.Account
{
Expand Down
24 changes: 17 additions & 7 deletions src/Areas/Identity/Pages/Account/LoginWithRecoveryCode.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// NodeGuard
// Copyright (C) 2025 Elenpay
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.

#nullable disable

using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using NodeGuard.Data.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using NodeGuard.Data.Models;
namespace NodeGuard.Areas.Identity.Pages.Account
{
public class LoginWithRecoveryCodeModel : PageModel
Expand Down
Loading
Loading