Compare commits

...

3 Commits

Author SHA1 Message Date
Robert Paciorek
17685e76d8 fix null exception in LoginParent 2025-06-27 14:46:23 +00:00
Robert Paciorek
bdd4111722 update dotnet version in Dockerfile 2025-06-27 14:37:19 +00:00
Spirtix
e03e732f33 fix indent 2025-06-27 14:17:05 +02:00
32 changed files with 284 additions and 279 deletions

View File

@ -48,8 +48,13 @@ public class AuthenticationController : Controller {
} else {
user = ctx.Users.FirstOrDefault(e => e.Username == data.UserName);
}
if (user is null) {
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidUserName });
}
PasswordVerificationResult result = new PasswordHasher<object>().VerifyHashedPassword(null, user.Password, data.Password);
if (user is null || result == PasswordVerificationResult.Failed) {
if (result == PasswordVerificationResult.Failed) {
return Ok(new ParentLoginInfo { Status = MembershipUserStatus.InvalidPassword });
}

View File

@ -1,5 +1,5 @@
# Use the official .NET SDK image for building the application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy the source code
@ -13,7 +13,7 @@ RUN mv src/mods /app && ln -s /app/mods src/
RUN mv src/assets /app && ln -s /app/assets src/
# Create clean run environment (without source and sdk)
# FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
# FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
# WORKDIR /app
# COPY --from=build /app .

View File

@ -3,7 +3,7 @@
namespace sodoff.Schema;
[XmlRoot(ElementName = "Mission", Namespace = "")]
[Serializable] // FIXME: Remove serializable once we have a different way of deep copying than BinaryFormatter
[Serializable]
public class Mission {
public Mission() { }