diff --git a/src/Server/Program.cs b/src/Server/Program.cs index 6c1bb66..ccfcc4e 100644 --- a/src/Server/Program.cs +++ b/src/Server/Program.cs @@ -14,6 +14,7 @@ using System.Configuration; using Microsoft.OpenApi.Models; using Shared.Models; using Microsoft.AspNetCore.ResponseCompression; +using System.Net; var builder = WebApplication.CreateBuilder(args); @@ -161,7 +162,7 @@ app.Use(async (context, next) => { if (!context.User.Identity?.IsAuthenticated ?? true) { - context.Response.Redirect("/Account/Login"); + context.Response.Redirect($"/Account/Login?ReturnUrl={WebUtility.UrlEncode("/swagger")}"); return; } diff --git a/src/Server/Views/Account/Login.cshtml b/src/Server/Views/Account/Login.cshtml index e3b132f..0db7e54 100644 --- a/src/Server/Views/Account/Login.cshtml +++ b/src/Server/Views/Account/Login.cshtml @@ -1,3 +1,4 @@ +@using Microsoft.Extensions.Primitives @using Server.Services @inject LocalizationService T @{ @@ -9,6 +10,10 @@