@post.Title
19 | @if (post.PublishTime != default(DateTimeOffset)) 20 | { 21 |@post.Excerpt
24 |Use this area to provide additional information.
10 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/About.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace BlogTemplate._1.Pages 8 | { 9 | public class AboutModel : PageModel 10 | { 11 | public string Message { get; set; } 12 | 13 | public void OnGet() 14 | { 15 | Message = "Your blog description page."; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model AccessDeniedModel 3 | @{ 4 | ViewData["Title"] = "Access denied"; 5 | } 6 | 7 |You do not have access to this resource.
10 |10 | Thank you for confirming your email. 11 |
12 |12 | You've successfully authenticated with @Model.LoginProvider. 13 | Please enter an email address for this site below and click the Register button to finish 14 | logging in. 15 |
16 | 17 |9 | Please check your email to reset your password. 10 |
11 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/ForgotPasswordConfirmation.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace BlogTemplate._1.Pages.Account 8 | { 9 | public class ForgotPasswordConfirmation : PageModel 10 | { 11 | public void OnGet() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/Lockout.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model LockoutModel 3 | @{ 4 | ViewData["Title"] = "Locked out"; 5 | } 6 | 7 |This account has been locked out, please try again later.
10 |Your login is protected with an authenticator app. Enter your authenticator code below.
10 |35 | Don't have access to your authenticator device? You can 36 | log in with a recovery code. 37 |
38 | 39 | @section Scripts { 40 | @await Html.PartialAsync("_ValidationScriptsPartial") 41 | } 42 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/LoginWithRecoveryCode.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model LoginWithRecoveryCodeModel 3 | @{ 4 | ViewData["Title"] = "Recovery code verification"; 5 | } 6 | 7 |10 | You have requested to log in with a recovery code. This login will not be remembered until you provide 11 | an authenticator app code at log in or disable 2FA and log in again. 12 |
13 |12 | 13 | This action only disables 2FA. 14 |
15 |16 | Disabling 2FA does not change the keys used in authenticator apps. If you wish to change the key 17 | used in an authenticator app you should reset your authenticator keys. 18 |
19 |To use an authenticator app go through the following steps:
11 |14 | Download a two-factor authenticator app like Microsoft Authenticator for 15 | Windows Phone, 16 | Android and 17 | iOS or 18 | Google Authenticator for 19 | Android and 20 | iOS. 21 |
22 |Scan the QR Code or enter this key @Model.SharedKey into your two factor authenticator app. Spaces and casing do not matter.
25 |31 | Once you have scanned the QR code or input the key above, your two factor authentication app will provide you 32 | with a unique code. Enter the code in the confirmation box below. 33 |
34 |@login.LoginProvider | 17 |18 | @if (Model.ShowRemoveButton) 19 | { 20 | 27 | } 28 | else 29 | { 30 | @: 31 | } 32 | | 33 |
11 | 12 | Put these codes in a safe place. 13 |
14 |15 | If you lose your device and don't have the recovery codes you will lose access to your account. 16 |
17 |@Model.RecoveryCodes[row]
@Model.RecoveryCodes[row + 1]
11 | 12 | If you reset your authenticator key your authenticator app will not work until you reconfigure it. 13 |
14 |15 | This process disables 2FA until you verify your authenticator app and will also reset your 2FA recovery codes. 16 | If you do not complete your authenticator app configuration you may lose access to your account. 17 |
18 |11 | You do not have a local username/password for this site. Add a local 12 | account so you can log in without an external login. 13 |
14 |You must generate a new set of recovery codes before you can log in with a recovery code.
15 |You can generate a new set of recovery codes.
22 |You should generate a new set of recovery codes.
29 |9 | Your password has been reset. Please click here to log in. 10 |
11 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/ResetPasswordConfirmation.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc.RazorPages; 6 | 7 | namespace BlogTemplate._1.Pages.Account 8 | { 9 | public class ResetPasswordConfirmationModel : PageModel 10 | { 11 | public void OnGet() 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/SignedOut.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model SignedOutModel 3 | @{ 4 | ViewData["Title"] = "Signed out"; 5 | } 6 | 7 |9 | You have successfully signed out. 10 |
11 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/SignedOut.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | public class SignedOutModel : PageModel 9 | { 10 | public IActionResult OnGet() 11 | { 12 | if (User.Identity.IsAuthenticated) 13 | { 14 | // Redirect to home page if the user is authenticated. 15 | return RedirectToPage("/Index"); 16 | } 17 | 18 | return Page(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Account/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using BlogTemplate._1.Pages.Account 2 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/AlreadyRegistered.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @{ 3 | ViewData["Title"] = "Already Registered"; 4 | } 5 | 6 |View and edit your saved drafts here.
11 | } 12 | else 13 | { 14 | foreach (var post in Model.DraftSummaries) 15 | { 16 |@post.Excerpt
24 |
13 | Request ID: @Model.RequestId
14 |
19 | Swapping to Development environment will display more detailed information about the error that occurred. 20 |
21 |22 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 23 |
24 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc.RazorPages; 7 | 8 | namespace BlogTemplate._1.Pages 9 | { 10 | public class ErrorModel : PageModel 11 | { 12 | public string RequestId { get; set; } 13 | 14 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 15 | 16 | public void OnGet() 17 | { 18 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /BlogTemplate/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home Page"; 5 | 6 | if (!Model.PostSummaries.Any()) 7 | { 8 | 13 | } 14 | 15 | else 16 | { 17 | foreach (var post in Model.PostSummaries) 18 | { 19 |There are no posts in your trash bin.
10 |@post.Excerpt
20 |