A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

More auth refactoring

+37 -44
+37 -12
src/Applications/UI/Authentication/State.elm
··· 24 24 import SHA 25 25 import String.Ext as String 26 26 import UI.Authentication.Types as Authentication exposing (..) 27 + import UI.Backdrop as Backdrop 27 28 import UI.Common.State as Common exposing (showNotification, showNotificationWithModel) 28 29 import UI.Interface.State as Interface 29 30 import UI.Ports as Ports ··· 209 210 bootFailure err model = 210 211 model 211 212 |> showNotification (Notifications.error err) 212 - |> andThen (Reply.translate LoadDefaultBackdrop) 213 + |> andThen Backdrop.setDefault 213 214 214 215 215 216 cancelFlow : Manager ··· 241 242 242 243 externalAuth : Method -> String -> Manager 243 244 externalAuth method string model = 244 - string 245 - |> Reply.ExternalAuth method 246 - |> Reply.translateWithModel model 245 + case method of 246 + Blockstack -> 247 + Alien.RedirectToBlockstackSignIn 248 + |> Alien.trigger 249 + |> Ports.toBrain 250 + |> return model 251 + 252 + Dropbox _ -> 253 + [ ( "response_type", "token" ) 254 + , ( "client_id", "te0c9pbeii8f8bw" ) 255 + , ( "redirect_uri", Common.urlOrigin model.url ++ "?action=authenticate/dropbox" ) 256 + ] 257 + |> Common.queryString 258 + |> String.append "https://www.dropbox.com/oauth2/authorize" 259 + |> Nav.load 260 + |> return model 261 + 262 + RemoteStorage _ -> 263 + string 264 + |> RemoteStorage.parseUserAddress 265 + |> Maybe.map 266 + (RemoteStorage.webfingerRequest RemoteStorageWebfinger) 267 + |> Maybe.unwrap 268 + (RemoteStorage.userAddressError 269 + |> Notifications.error 270 + |> Common.showNotificationWithModel model 271 + ) 272 + (return model) 273 + 274 + _ -> 275 + Return.singleton model 247 276 248 277 249 278 missingSecretKey : Json.Value -> Manager ··· 251 280 "There seems to be existing data that's encrypted, I will need the passphrase (ie. encryption key) to continue." 252 281 |> Notifications.error 253 282 |> showNotificationWithModel model 254 - |> andThen (Reply.translate <| Reply.LoadDefaultBackdrop) 255 - |> andThen (Reply.translate <| Reply.ToggleLoadingScreen Off) 283 + |> andThen Backdrop.setDefault 284 + |> andThen (Interface.toggleLoadingScreen Off) 256 285 257 286 258 287 notAuthenticated : Manager ··· 260 289 -- This is the message we get when the app initially 261 290 -- finds out we're not authenticated. 262 291 andThen 263 - (Reply.translate Reply.LoadDefaultBackdrop) 292 + Backdrop.setDefault 264 293 (if model.isUpgrading then 265 294 """ 266 295 Thank you for using Diffuse V1! ··· 512 541 pingOtherIpfs (String.chopEnd "/" value) model 513 542 514 543 InputScreen (RemoteStorage r) { value } -> 515 - -- TODO: 516 - -- addReply 517 - -- (ExternalAuth (RemoteStorage r) value) 518 - -- (return model) 519 - Return.singleton model 544 + externalAuth (RemoteStorage r) value model 520 545 521 546 InputScreen (Textile t) { value } -> 522 547 pingOtherTextile (String.chopEnd "/" value) model
-1
src/Applications/UI/Reply.elm
··· 30 30 ----------------------------------------- 31 31 -- Authentication 32 32 ----------------------------------------- 33 - | ExternalAuth User.Layer.Method String 34 33 | ImportLegacyData 35 34 | PingIpfsForAuth 36 35 | PingTextileForAuth
-31
src/Applications/UI/Reply/Translate.elm
··· 101 101 ----------------------------------------- 102 102 -- Authentication 103 103 ----------------------------------------- 104 - ExternalAuth Blockstack _ -> 105 - Alien.RedirectToBlockstackSignIn 106 - |> Alien.trigger 107 - |> Ports.toBrain 108 - |> return model 109 - 110 - ExternalAuth (Dropbox _) _ -> 111 - [ ( "response_type", "token" ) 112 - , ( "client_id", "te0c9pbeii8f8bw" ) 113 - , ( "redirect_uri", Common.urlOrigin model.url ++ "?action=authenticate/dropbox" ) 114 - ] 115 - |> Common.queryString 116 - |> String.append "https://www.dropbox.com/oauth2/authorize" 117 - |> Nav.load 118 - |> return model 119 - 120 - ExternalAuth (RemoteStorage _) input -> 121 - input 122 - |> RemoteStorage.parseUserAddress 123 - |> Maybe.map 124 - (RemoteStorage.webfingerRequest RemoteStorageWebfinger) 125 - |> Maybe.unwrap 126 - (translate 127 - (ShowErrorNotification RemoteStorage.userAddressError) 128 - model 129 - ) 130 - (return model) 131 - 132 - ExternalAuth _ _ -> 133 - Return.singleton model 134 - 135 104 ImportLegacyData -> 136 105 Alien.ImportLegacyData 137 106 |> Alien.trigger