diff --git a/src/web/ui/src/Login/Login.fs b/src/web/ui/src/Login/Login.fs index c9fba833b..2f9150665 100644 --- a/src/web/ui/src/Login/Login.fs +++ b/src/web/ui/src/Login/Login.fs @@ -36,14 +36,14 @@ let loginMsg user pass = let update msg model = match msg with - | Username u -> { model with user = u; error = "" }, Cmd.Empty + | Username u -> { model with user = u.ToLower(); error = "" }, Cmd.Empty | Password p -> { model with password = p; error = "" }, Cmd.Empty | Help -> Global.alert Global.Info "Call support" model, Cmd.Empty | Submit -> printfn "Login with %s %s" model.user model.password - model, loginMsg model.user model.password + model, loginMsg (model.user.ToLower()) model.password | LoginFailure msg -> { model with error = msg }, Cmd.Empty | LoginSuccess _ -> failwith "Handled externally. Should not get here." diff --git a/src/web/ui/src/Users/State.fs b/src/web/ui/src/Users/State.fs index 69e47b3e6..33ad1631a 100644 --- a/src/web/ui/src/Users/State.fs +++ b/src/web/ui/src/Users/State.fs @@ -236,8 +236,8 @@ let update msg (model:Users.Types.Model) : Model * Cmd = | SaveUser -> // match on id = 0 to see if it's a new user match model.scratchUser.id with - | 0u -> { model with PreviousScratchUser = model.scratchUser}, Cmd.ofExistingPromise (createUser model.admin model.scratchUser) id (box>>ErrorOccured) - | _ -> model, Cmd.ofExistingPromise (saveUser model.admin model.scratchUser) id (box>>ErrorOccured) + | 0u -> { model with PreviousScratchUser = model.scratchUser}, Cmd.ofExistingPromise (createUser model.admin {model.scratchUser with name = model.scratchUser.name.ToLower() }) id (box>>ErrorOccured) + | _ -> model, Cmd.ofExistingPromise (saveUser model.admin {model.scratchUser with name = model.scratchUser.name.ToLower() }) id (box>>ErrorOccured) | ErrorOccured msg -> //Browser.console.log msg Global.alert Global.Error (string msg)