diff --git a/EnvelopeGenerator.Application/Resources/Resource.de-DE.resx b/EnvelopeGenerator.Application/Resources/Resource.de-DE.resx
index 6b26b6cd..ece65ad1 100644
--- a/EnvelopeGenerator.Application/Resources/Resource.de-DE.resx
+++ b/EnvelopeGenerator.Application/Resources/Resource.de-DE.resx
@@ -141,4 +141,10 @@
Dokument erfordert einen Zugriffscode
+
+ Ein unerwarteter Fehler ist aufgetreten.
+
+
+ Ungültiger Zugangscode.
+
\ No newline at end of file
diff --git a/EnvelopeGenerator.Application/Resources/Resource.en-US.resx b/EnvelopeGenerator.Application/Resources/Resource.en-US.resx
index 226ae4d3..87e3bae3 100644
--- a/EnvelopeGenerator.Application/Resources/Resource.en-US.resx
+++ b/EnvelopeGenerator.Application/Resources/Resource.en-US.resx
@@ -141,4 +141,10 @@
Document requires an access code
+
+ An unexpected error has occurred.
+
+
+ Invalid access code.
+
\ No newline at end of file
diff --git a/EnvelopeGenerator.Web/Controllers/HomeController.cs b/EnvelopeGenerator.Web/Controllers/HomeController.cs
index d9b6ac9e..3124b938 100644
--- a/EnvelopeGenerator.Web/Controllers/HomeController.cs
+++ b/EnvelopeGenerator.Web/Controllers/HomeController.cs
@@ -154,10 +154,18 @@ namespace EnvelopeGenerator.Web.Controllers
return this.ViewDocumentNotFound();
}
- var claims = new List { new(ClaimTypes.NameIdentifier, uuid), new(ClaimTypes.Hash, signature) };
+ var claims = new List {
+ new(ClaimTypes.NameIdentifier, uuid),
+ new(ClaimTypes.Hash, signature),
+ new(ClaimTypes.Name, er.Name ?? string.Empty),
+ new(ClaimTypes.Email, er.Receiver.EmailAddress),
+ new(EnvelopeClaimTypes.Title, er.Envelope.Title)
+ };
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
- var authProperties = new AuthenticationProperties { };
+ var authProperties = new AuthenticationProperties {
+ AllowRefresh = false
+ };
await HttpContext.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
diff --git a/EnvelopeGenerator.Web/EnvelopeClaimTypes.cs b/EnvelopeGenerator.Web/EnvelopeClaimTypes.cs
new file mode 100644
index 00000000..dc32c4cb
--- /dev/null
+++ b/EnvelopeGenerator.Web/EnvelopeClaimTypes.cs
@@ -0,0 +1,13 @@
+namespace EnvelopeGenerator.Web
+{
+ ///
+ /// Provides custom claim types for envelope-related information.
+ ///
+ public static class EnvelopeClaimTypes
+ {
+ ///
+ /// Claim type for the title of an envelope.
+ ///
+ public static readonly string Title = $"Envelope{nameof(Title)}";
+ }
+}
\ No newline at end of file
diff --git a/EnvelopeGenerator.Web/Program.cs b/EnvelopeGenerator.Web/Program.cs
index 0f8f8cf6..63683680 100644
--- a/EnvelopeGenerator.Web/Program.cs
+++ b/EnvelopeGenerator.Web/Program.cs
@@ -129,7 +129,8 @@ try
options.Cookie.HttpOnly = true; // Makes the cookie inaccessible to client-side scripts for security
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest; // Ensures cookies are sent over HTTPS only
options.Cookie.SameSite = SameSiteMode.Strict; // Protects against CSRF attacks by restricting how cookies are sent with requests from external sites
-
+ options.ExpireTimeSpan = TimeSpan.FromMinutes(5);
+
options.Events = new CookieAuthenticationEvents
{
OnRedirectToLogin = context =>
diff --git a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml b/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml
index 1c47d49c..7807ee45 100644
--- a/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml
+++ b/EnvelopeGenerator.Web/Views/Shared/_Layout.cshtml
@@ -22,6 +22,7 @@
+
@await RenderSectionAsync("Scripts", required: false)
diff --git a/EnvelopeGenerator.Web/wwwroot/js/api.js b/EnvelopeGenerator.Web/wwwroot/js/api.js
new file mode 100644
index 00000000..6a47cd3c
--- /dev/null
+++ b/EnvelopeGenerator.Web/wwwroot/js/api.js
@@ -0,0 +1,7 @@
+const submitForm = async form => await fetch(form.action, {
+ method: form.method,
+ body: new FormData(form),
+ headers: {
+ "X-Requested-With": "XMLHttpRequest"
+ }
+})
\ No newline at end of file
diff --git a/EnvelopeGenerator.Web/wwwroot/js/ui.js b/EnvelopeGenerator.Web/wwwroot/js/ui.js
index 7ebd9047..4f5af53b 100644
--- a/EnvelopeGenerator.Web/wwwroot/js/ui.js
+++ b/EnvelopeGenerator.Web/wwwroot/js/ui.js
@@ -123,4 +123,4 @@
return annotationPresets
}
-}
+}
\ No newline at end of file