Skip to content

Commit

Permalink
Fix redirect after stack update, refs cozy#195
Browse files Browse the repository at this point in the history
  • Loading branch information
clochix authored and paultranvan committed Apr 4, 2016
1 parent 9b985bc commit d71bdf0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion client/app/states/auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ module.exports = class Auth extends StateModel
@success.map @get 'next'
.onValue (next) ->
setTimeout ->
window.location.pathname = next
# /!\ we can't set only the pathname here, because
# Chrome encodes it, replacing # with %23 See #195
loc = window.location
window.location.href = "#{loc.protocol}//#{loc.host}#{next}"
, 500


Expand Down
7 changes: 5 additions & 2 deletions client/app/states/registration.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ module.exports = class Registration extends StateModel
@setStepBus
.filter (value) => !(value in Object.keys @steps)
.onValue (path) ->
window.location.pathname = path
# /!\ we can't set only the pathname here, because
# Chrome encodes it, replacing # with %23 See #195
loc = window.location
window.location.href = "#{loc.protocol}//#{loc.host}#{next}"


# Add the `nextControl` property ti the state-machine
Expand Down Expand Up @@ -171,7 +174,7 @@ module.exports = class Registration extends StateModel
- data: an object containing the form input entries as key/values pairs
###
setEmailSubmit: (data) =>
setEmailSubmit: (data) ->
# Map form data to the _email_ app endpoint expected form
login = data['imap-login'] or data.email
accountData =
Expand Down

0 comments on commit d71bdf0

Please sign in to comment.