Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. -- Error found:
  2. -- in module SlamData.SignIn.Component
  3. -- at /Users/beckyconning/Documents/slamdata/src/SlamData/SignIn/Component.purs line 175, column 3 - lin
  4. -- e 182, column 3
  5. --
  6. -- Could not match type
  7. --
  8. -- FreeT
  9. -- (Emit
  10. -- { target :: EventTarget
  11. -- , "type" :: String
  12. -- , bubbles :: Boolean
  13. -- , cancelable :: Boolean
  14. -- , key :: String
  15. -- , oldValue :: String
  16. -- , newValue :: String
  17. -- , url :: String
  18. -- , storageArea :: Storage
  19. -- }
  20. -- )
  21. -- (Aff
  22. -- ( dom :: DOM
  23. -- , avar :: AVAR
  24. -- | _4
  25. -- )
  26. -- )
  27. -- Unit
  28. --
  29. -- with type
  30. --
  31. -- Unit
  32. submenuPeek
  33. ∷ ∀ a
  34. . HalogenMenu.SubmenuQuery (Maybe ProviderR) a
  35. → SignInDSL Unit
  36. submenuPeek (HalogenMenu.SelectSubmenuItem v _) = do
  37. H.subscribe'
  38. $ HE.EventSource
  39. $ StallingCoroutine.mapStallingProducer (const $ Init unit)
  40. $ StallingCoroutine.filter isIdTokenKeyEvent
  41. $ StallingCoroutine.producerToStallingProducer
  42. $ LocalStorage.storageEventProducer false
  43.  
  44. {loggedIn} ← H.get
  45. if loggedIn
  46. then logOut
  47. else for_ v $ either (const $ pure unit) (H.fromEff ∘ openPopup) <=< requestAuthenticationURI
  48. pure unit
  49. where
  50. isIdTokenKeyEvent o = o.key == Auth.idTokenLocalStorageKey
  51. logOut ∷ SignInDSL Unit
  52. logOut = do
  53. H.fromEff do
  54. Auth.clearIdToken
  55. Browser.reload
  56. appendAuthPath s = s ++ Config.redirectURIString
  57. requestAuthenticationURI pr =
  58. H.fromEff $ OIDC.requestAuthenticationURI OIDC.Login pr ∘ appendAuthPath =<< Browser.locationString
  59. openPopup stringUrl = do
  60. window ← DOMHTML.window
  61. windowFeaturesStr ← DOMUtils.centerPopupWindowFeatures 800 400 window
  62. DOMUtils.open stringUrl "SignIn" windowFeaturesStr window
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement