v 3.1 #42

Merged
danieljsummers merged 3 commits from 3.1 into main 2023-07-03 00:00:16 +00:00
9 changed files with 38 additions and 18 deletions
Showing only changes of commit 3f75f71388 - Show all commits

View File

@ -25,4 +25,8 @@
<ProjectReference Include="..\SuccessStories\JobsJobsJobs.SuccessStories.fsproj" /> <ProjectReference Include="..\SuccessStories\JobsJobsJobs.SuccessStories.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>

View File

@ -78,10 +78,8 @@ let register (citizen : Citizen) (security : SecurityInfo) = backgroundTask {
} }
/// Try to find the security information matching a confirmation token /// Try to find the security information matching a confirmation token
let private tryConfirmToken (token : string) = backgroundTask { let private tryConfirmToken (token : string) =
let! tryInfo = Find.byContains<SecurityInfo> Table.SecurityInfo {| token = token; tokenUsage = "confirm" |} Find.firstByContains<SecurityInfo> Table.SecurityInfo {| token = token; tokenUsage = "confirm" |}
return List.tryHead tryInfo
}
/// Confirm a citizen's account /// Confirm a citizen's account
let confirmAccount token = backgroundTask { let confirmAccount token = backgroundTask {
@ -104,11 +102,10 @@ let denyAccount token = backgroundTask {
} }
/// Attempt a user log on /// Attempt a user log on
let tryLogOn email password (pwVerify : Citizen -> string -> bool option) (pwHash : Citizen -> string -> string) let tryLogOn (email : string) password (pwVerify : Citizen -> string -> bool option)
now = backgroundTask { (pwHash : Citizen -> string -> string) now = backgroundTask {
do! checkForPurge false do! checkForPurge false
let! tryCitizen = Find.byContains<Citizen> Table.Citizen {| email = email |} match! Find.firstByContains<Citizen> Table.Citizen {| email = email |} with
match List.tryHead tryCitizen with
| Some citizen -> | Some citizen ->
let citizenId = CitizenId.toString citizen.Id let citizenId = CitizenId.toString citizen.Id
let! tryInfo = Find.byId<SecurityInfo> Table.SecurityInfo citizenId let! tryInfo = Find.byId<SecurityInfo> Table.SecurityInfo citizenId
@ -149,6 +146,5 @@ let tryByEmailWithSecurity email =
/// Try to retrieve security information by the given token /// Try to retrieve security information by the given token
let trySecurityByToken (token : string) = backgroundTask { let trySecurityByToken (token : string) = backgroundTask {
do! checkForPurge false do! checkForPurge false
let! results = Find.byContains<SecurityInfo> Table.SecurityInfo {| token = token |} return! Find.firstByContains<SecurityInfo> Table.SecurityInfo {| token = token |}
return List.tryHead results
} }

View File

@ -16,4 +16,8 @@
<ProjectReference Include="..\Profiles\JobsJobsJobs.Profiles.fsproj" /> <ProjectReference Include="..\Profiles\JobsJobsJobs.Profiles.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>

View File

@ -15,18 +15,19 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="1.0.0-beta2" /> <PackageReference Include="BitBadger.Npgsql.FSharp.Documents" Version="1.0.0-beta3" />
<PackageReference Include="FSharp.SystemTextJson" Version="1.1.23" /> <PackageReference Include="FSharp.SystemTextJson" Version="1.1.23" />
<PackageReference Include="Giraffe" Version="6.0.0" /> <PackageReference Include="Giraffe" Version="6.0.0" />
<PackageReference Include="Giraffe.Htmx" Version="1.8.5" /> <PackageReference Include="Giraffe.Htmx" Version="1.9.2" />
<PackageReference Include="Giraffe.ViewEngine" Version="1.4.0" /> <PackageReference Include="Giraffe.ViewEngine" Version="1.4.0" />
<PackageReference Include="Giraffe.ViewEngine.Htmx" Version="1.8.5" /> <PackageReference Include="Giraffe.ViewEngine.Htmx" Version="1.9.2" />
<PackageReference Include="MailKit" Version="3.3.0" /> <PackageReference Include="MailKit" Version="4.1.0" />
<PackageReference Include="Markdig" Version="0.30.4" /> <PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" /> <PackageReference Include="NodaTime.Serialization.JsonNet" Version="3.0.0" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" /> <PackageReference Include="NodaTime.Serialization.SystemTextJson" Version="1.0.0" />
<PackageReference Include="Npgsql.FSharp" Version="5.6.0" /> <PackageReference Include="Npgsql.FSharp" Version="5.7.0" />
<PackageReference Include="Npgsql.NodaTime" Version="7.0.1" /> <PackageReference Include="Npgsql.NodaTime" Version="7.0.4" />
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -13,4 +13,8 @@
<ProjectReference Include="..\Common\JobsJobsJobs.Common.fsproj" /> <ProjectReference Include="..\Common\JobsJobsJobs.Common.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>

View File

@ -16,4 +16,8 @@
<ProjectReference Include="..\SuccessStories\JobsJobsJobs.SuccessStories.fsproj" /> <ProjectReference Include="..\SuccessStories\JobsJobsJobs.SuccessStories.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>

View File

@ -15,4 +15,8 @@
<ProjectReference Include="..\Common\JobsJobsJobs.Common.fsproj" /> <ProjectReference Include="..\Common\JobsJobsJobs.Common.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>

View File

@ -4,7 +4,6 @@ open BitBadger.Npgsql.FSharp.Documents
open JobsJobsJobs.Common.Data open JobsJobsJobs.Common.Data
open JobsJobsJobs.Domain open JobsJobsJobs.Domain
open JobsJobsJobs.SuccessStories.Domain open JobsJobsJobs.SuccessStories.Domain
open Npgsql.FSharp
// Retrieve all success stories // Retrieve all success stories
let all () = let all () =

View File

@ -17,4 +17,8 @@
<ProjectReference Include="..\Profiles\JobsJobsJobs.Profiles.fsproj" /> <ProjectReference Include="..\Profiles\JobsJobsJobs.Profiles.fsproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Update="FSharp.Core" Version="7.0.300" />
</ItemGroup>
</Project> </Project>