From 8ab3182c21e147f190818ed7baea7ee0916d8f03 Mon Sep 17 00:00:00 2001 From: Michael Harding Date: Tue, 12 Jun 2018 17:33:12 -0400 Subject: [PATCH] SPARK-1241: Username.ToLower --- src/web/ui/src/Login/Login.fs | 4 ++-- src/web/ui/src/Users/State.fs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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)