SPARK-1241: Username.ToLower
This commit is contained in:
1 parent
508e2d4fcf
commit
8ab3182c21
2 files changed
+4
-4
No files matched your search
@@ -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."
|
||||
|
||||
@@ -236,8 +236,8 @@ let update msg (model:Users.Types.Model) : Model * Cmd<Msg> =
|
||||
| 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)
|
||||
|
||||
Reference in new issue
Block a user