diff --git a/content/application/src/Bolero.Template.1.Client/Main.fs b/content/application/src/Bolero.Template.1.Client/Main.fs index 127b8cf..0998453 100644 --- a/content/application/src/Bolero.Template.1.Client/Main.fs +++ b/content/application/src/Bolero.Template.1.Client/Main.fs @@ -98,6 +98,7 @@ type Message = //#if (server) | SetUsername of string | SetPassword of string + | ClearLoginForm | GetSignedInAs | RecvSignedInAs of option | SendSignIn @@ -111,7 +112,7 @@ type Message = //#if (server) let update remote message model = let onSignIn = function - | Some _ -> Cmd.ofMsg GetBooks + | Some _ -> Cmd.batch [ Cmd.ofMsg GetBooks; Cmd.ofMsg ClearLoginForm ] | None -> Cmd.none //#else let update (http: HttpClient) message model = @@ -143,6 +144,10 @@ let update (http: HttpClient) message model = { model with username = s }, Cmd.none | SetPassword s -> { model with password = s }, Cmd.none + | ClearLoginForm -> + { model with + username = "" + password = "" }, Cmd.none | GetSignedInAs -> model, Cmd.OfAuthorized.either remote.getUsername () RecvSignedInAs Error | RecvSignedInAs username ->