Skip to content

Commit

Permalink
Merge pull request #48 from fsbolero/clear-login-form
Browse files Browse the repository at this point in the history
Clear login form on sign in
  • Loading branch information
Tarmil authored Dec 17, 2023
2 parents 41fb14d + 5e12c38 commit 4588137
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion content/application/src/Bolero.Template.1.Client/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ type Message =
//#if (server)
| SetUsername of string
| SetPassword of string
| ClearLoginForm
| GetSignedInAs
| RecvSignedInAs of option<string>
| SendSignIn
Expand All @@ -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 =
Expand Down Expand Up @@ -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 ->
Expand Down

0 comments on commit 4588137

Please sign in to comment.