Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Error found:
- -- in module SlamData.SignIn.Component
- -- at /Users/beckyconning/Documents/slamdata/src/SlamData/SignIn/Component.purs line 175, column 3 - lin
- -- e 182, column 3
- --
- -- Could not match type
- --
- -- FreeT
- -- (Emit
- -- { target :: EventTarget
- -- , "type" :: String
- -- , bubbles :: Boolean
- -- , cancelable :: Boolean
- -- , key :: String
- -- , oldValue :: String
- -- , newValue :: String
- -- , url :: String
- -- , storageArea :: Storage
- -- }
- -- )
- -- (Aff
- -- ( dom :: DOM
- -- , avar :: AVAR
- -- | _4
- -- )
- -- )
- -- Unit
- --
- -- with type
- --
- -- Unit
- submenuPeek
- ∷ ∀ a
- . HalogenMenu.SubmenuQuery (Maybe ProviderR) a
- → SignInDSL Unit
- submenuPeek (HalogenMenu.SelectSubmenuItem v _) = do
- H.subscribe'
- $ HE.EventSource
- $ StallingCoroutine.mapStallingProducer (const $ Init unit)
- $ StallingCoroutine.filter isIdTokenKeyEvent
- $ StallingCoroutine.producerToStallingProducer
- $ LocalStorage.storageEventProducer false
- {loggedIn} ← H.get
- if loggedIn
- then logOut
- else for_ v $ either (const $ pure unit) (H.fromEff ∘ openPopup) <=< requestAuthenticationURI
- pure unit
- where
- isIdTokenKeyEvent o = o.key == Auth.idTokenLocalStorageKey
- logOut ∷ SignInDSL Unit
- logOut = do
- H.fromEff do
- Auth.clearIdToken
- Browser.reload
- appendAuthPath s = s ++ Config.redirectURIString
- requestAuthenticationURI pr =
- H.fromEff $ OIDC.requestAuthenticationURI OIDC.Login pr ∘ appendAuthPath =<< Browser.locationString
- openPopup stringUrl = do
- window ← DOMHTML.window
- windowFeaturesStr ← DOMUtils.centerPopupWindowFeatures 800 400 window
- DOMUtils.open stringUrl "SignIn" windowFeaturesStr window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement