aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src
diff options
context:
space:
mode:
Diffstat (limited to 'code/api/src')
-rw-r--r--code/api/src/Program.cs9
-rw-r--r--code/api/src/Resources/SharedResources.en.Designer.cs6
-rw-r--r--code/api/src/Resources/SharedResources.en.resx4
-rw-r--r--code/api/src/Resources/SharedResources.nb.Designer.cs12
-rw-r--r--code/api/src/Resources/SharedResources.nb.resx7
-rw-r--r--code/api/src/Resources/SharedResources.resx3
6 files changed, 36 insertions, 5 deletions
diff --git a/code/api/src/Program.cs b/code/api/src/Program.cs
index 87f0537..749c60a 100644
--- a/code/api/src/Program.cs
+++ b/code/api/src/Program.cs
@@ -1,8 +1,6 @@
global using System;
global using System.Linq;
global using System.IO;
-global using System.Net.Mail;
-global using System.Net;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Collections.Generic;
@@ -74,6 +72,7 @@ public static class Program
new JsonSerializerOptions() {
WriteIndented = true
}));
+
builder.Host.UseSerilog(Log.Logger);
builder.WebHost.ConfigureKestrel(kestrel => { kestrel.AddServerHeader = false; });
@@ -87,7 +86,7 @@ public static class Program
builder.Services.AddLocalization(options => { options.ResourcesPath = "Resources"; });
builder.Services.AddRequestLocalization(options => {
- var supportedCultures = new[] {"en-gb", "no-nb"};
+ var supportedCultures = new[] {"en", "nb"};
options.SetDefaultCulture(supportedCultures[0])
.AddSupportedCultures(supportedCultures)
.AddSupportedUICultures(supportedCultures);
@@ -110,7 +109,6 @@ public static class Program
});
builder.Services.AddQuartzHostedService(options => { options.WaitForJobsToComplete = true; });
-
builder.Services.AddAuthentication(options => {
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
@@ -176,11 +174,13 @@ public static class Program
}
});
});
+
builder.Services.AddPagination(options => {
options.DefaultSize = 50;
options.MaxSize = 100;
options.CanChangeSizeFromQuery = true;
});
+
builder.Services
.AddControllers()
.AddDataAnnotationsLocalization()
@@ -191,7 +191,6 @@ public static class Program
public static WebApplication CreateWebApplication(WebApplicationBuilder builder) {
var app = builder.Build();
-
if (app.Environment.IsDevelopment()) {
app.UseDeveloperExceptionPage();
app.UseCors(cors => {
diff --git a/code/api/src/Resources/SharedResources.en.Designer.cs b/code/api/src/Resources/SharedResources.en.Designer.cs
index 4eb786f..02ada48 100644
--- a/code/api/src/Resources/SharedResources.en.Designer.cs
+++ b/code/api/src/Resources/SharedResources.en.Designer.cs
@@ -74,5 +74,11 @@ namespace IOL.GreatOffice.Api.Resources {
return ResourceManager.GetString("One or more fields is invalid", resourceCulture);
}
}
+
+ internal static string Invalid_username_or_password {
+ get {
+ return ResourceManager.GetString("Invalid username or password", resourceCulture);
+ }
+ }
}
}
diff --git a/code/api/src/Resources/SharedResources.en.resx b/code/api/src/Resources/SharedResources.en.resx
index 5987e8d..87e46e0 100644
--- a/code/api/src/Resources/SharedResources.en.resx
+++ b/code/api/src/Resources/SharedResources.en.resx
@@ -38,4 +38,8 @@
<value>One or more fields is invalid</value>
<comment>One or more fields is invalid</comment>
</data>
+ <data name="Invalid username or password" xml:space="preserve">
+ <value>Invalid username or password</value>
+ <comment>Invalid username or password</comment>
+ </data>
</root> \ No newline at end of file
diff --git a/code/api/src/Resources/SharedResources.nb.Designer.cs b/code/api/src/Resources/SharedResources.nb.Designer.cs
index 114c86f..37006f2 100644
--- a/code/api/src/Resources/SharedResources.nb.Designer.cs
+++ b/code/api/src/Resources/SharedResources.nb.Designer.cs
@@ -68,5 +68,17 @@ namespace IOL.GreatOffice.Api.Resources {
return ResourceManager.GetString("One or more fields is invalid", resourceCulture);
}
}
+
+ internal static string Invalid_username_or_password {
+ get {
+ return ResourceManager.GetString("Invalid username or password", resourceCulture);
+ }
+ }
+
+ internal static string One_or_more_validation_errors_occured {
+ get {
+ return ResourceManager.GetString("One or more validation errors occured", resourceCulture);
+ }
+ }
}
}
diff --git a/code/api/src/Resources/SharedResources.nb.resx b/code/api/src/Resources/SharedResources.nb.resx
index 6c8937b..880274e 100644
--- a/code/api/src/Resources/SharedResources.nb.resx
+++ b/code/api/src/Resources/SharedResources.nb.resx
@@ -39,4 +39,11 @@
<comment>One or more fields is invalid</comment>
<value>En eller flere felt er ugyldige</value>
</data>
+ <data name="Invalid username or password" xml:space="preserve">
+ <value>Ugyldig brukernavn eller passord</value>
+ <comment>Invalid username or password</comment>
+ </data>
+ <data name="One or more validation errors occured" xml:space="preserve">
+ <value>En eller flere valideringsfeil har oppstått</value>
+ </data>
</root> \ No newline at end of file
diff --git a/code/api/src/Resources/SharedResources.resx b/code/api/src/Resources/SharedResources.resx
index 377994b..833428b 100644
--- a/code/api/src/Resources/SharedResources.resx
+++ b/code/api/src/Resources/SharedResources.resx
@@ -27,4 +27,7 @@
<value>One or more fields is invalid</value>
<comment>One or more fields is invalid</comment>
</data>
+ <data name="Invalid username or password" xml:space="preserve">
+ <value />
+ </data>
</root> \ No newline at end of file