AuthForm: WS disconnection on successful authentication.
parent
e44b1aebe9
commit
7804dd6647
|
@ -141,6 +141,7 @@ data Action
|
||||||
| HandleLoginInputUpdate String
|
| HandleLoginInputUpdate String
|
||||||
| HandlePassInputUpdate String
|
| HandlePassInputUpdate String
|
||||||
| AuthenticationAttempt Event
|
| AuthenticationAttempt Event
|
||||||
|
| Finalize
|
||||||
| HandleWebSocket (WebSocketEvent WebSocketMessageType)
|
| HandleWebSocket (WebSocketEvent WebSocketMessageType)
|
||||||
|
|
||||||
type State =
|
type State =
|
||||||
|
@ -161,6 +162,7 @@ component =
|
||||||
, eval: H.mkEval $ H.defaultEval
|
, eval: H.mkEval $ H.defaultEval
|
||||||
{ initialize = Just Initialize
|
{ initialize = Just Initialize
|
||||||
, handleAction = handleAction
|
, handleAction = handleAction
|
||||||
|
, finalize = Just Finalize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +261,13 @@ handleAction = case _ of
|
||||||
Initialize ->
|
Initialize ->
|
||||||
handleAction ConnectWebSocket
|
handleAction ConnectWebSocket
|
||||||
|
|
||||||
|
Finalize -> do
|
||||||
|
{ wsConnection } <- H.get
|
||||||
|
systemMessage "Finalize"
|
||||||
|
case wsConnection of
|
||||||
|
Nothing -> systemMessage "No socket? How is that even possible?"
|
||||||
|
Just socket -> H.liftEffect $ WS.close socket
|
||||||
|
|
||||||
WebSocketParseError error ->
|
WebSocketParseError error ->
|
||||||
systemMessage $ renderError (UnknownError error)
|
systemMessage $ renderError (UnknownError error)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue