FastBoot Compatibility #1035

Merged
merged 45 commits into from Dec 6, 2016

Projects

None yet

10 participants

@marcoow
Member
marcoow commented Jul 28, 2016 edited

This makes Ember Simple Auth compatible with FastBoot.

The goal of this is for Ember Simple auth to support FastBoot out of the box without the need for anyone to change anything to their ESA setup (except for switching to the cookie session store as localStorage doesn't work in FastBoot obviously).

TODO

  • replace window.btoa with sth. that works in FastBoot (FastBoot exposes a window global (which is the sandbox) which means this works already)
  • replace window.location with sth. that works in FastBoot
  • don't try binding to localStorage events with jQuery when running in FastBoot
  • inject the FastBoot service into the cookie store manually in an initializer
  • write integration tests using ember-cli-addon-tests
  • use ember-network instead of jQuery's AJAX methods, see #1066
  • replace occurences of jQuery, window etc. in the docs with sth. that works in FastBoot
  • fix tests (FastBoot tests seem to fail randomly - must be some sort of race condition or so)
@marcoow marcoow added the feature label Jul 28, 2016
@marcoow marcoow added this to the 1.2 milestone Jul 28, 2016
@marcoow marcoow self-assigned this Jul 28, 2016
This was referenced Jul 28, 2016
@marcoow
Member
marcoow commented Jul 28, 2016

rebased on master

@mhluska mhluska commented on the diff Jul 30, 2016
addon/session-stores/cookie.js
@@ -143,8 +166,7 @@ export default BaseStore.extend({
},
_read(name) {
- let value = document.cookie.match(new RegExp(`${name}=([^;]+)`)) || [];
- return decodeURIComponent(value[1] || '');
+ return this.get('_cookies').read(name) || '';
@mhluska
mhluska Jul 30, 2016 edited

This is throwing an error in FastBoot because recent versions of Ember don't like injected properties in objects without a container:

Error: Assertion Failed: Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.

@arjansingh
arjansingh Aug 1, 2016 Contributor

I ran into this... the solution (which might have been rebased out) was to manually inject the cookies service. Did the rebasing mess that up?

https://github.com/simplabs/ember-simple-auth/blob/2d49133ec8543ae53af713d7551072ba49f65ce7/addon/initializers/setup-session.js#L17

@marcoow
marcoow Aug 1, 2016 Member

@arjansingh: yeah, I might have messed that up during rebasing 😳

@josemarluedke
josemarluedke Aug 4, 2016

I can confirm that this is a problem.

@marcoow
marcoow Aug 4, 2016 Member

I'm going to fix that. Sorry for that - I really shouldn't be breaking great work of people who want to contribute 😔

@marcoow
marcoow Nov 8, 2016 edited Member

This is actually only generating an error when using the adaptive store. Of course that should work as well as the adaptive store should simply fallback to the cookie store and work out of the box (although the session would not actually be transported between the client and server then as the client would use localStorage). It should certainly not lead to an error though.

I'll add a test case for that and make sure it doesn't raise.

@arjansingh
Contributor

Forgot to rename some of the commits but let's make sure to get rid of the WIP and DRAFT commit messages when we do the final rebase. Sorry about that.

@josemarluedke
josemarluedke commented Aug 12, 2016 edited

@marcoow I have a open PR that adds integration testing for fastboot in #1045. These tests are basic and can be improved over time, but I think they are a good start.

With that, I think we can say we have a basic support for fastboot. 🎉

@marcoow
Member
marcoow commented Aug 12, 2016

@josemarluedke: awesome - thanks for the hard work! Will review and merge as soon as possible.

@briangonzalez

@marcoow Any idea when this will land?

@marcoow
Member
marcoow commented Sep 5, 2016

@briangonzalez: we're hoping soon ;)

A bunch of people are working on it and also related changes that are necessary in ember-cookies. I just returned from vacation and hope we manage to release a beta this month.

arjansingh and others added some commits Apr 16, 2016
@arjansingh @marcoow arjansingh DRAFT - Fastboot compatibility 6cc67fc
@marcoow marcoow improve fastboot support fb610c0
@marcoow marcoow add FastBoot info to README 4e30bfb
@marcoow marcoow fix tests f084b32
@marcoow marcoow better name for api host conf setting 842351f
@marcoow marcoow WIP: fixing tests a07843b
@marcoow marcoow fix tests 86ef6fa
@mike-north @marcoow mike-north Use version of ember-cookies with fix for fasboot fd6477e
@mike-north @marcoow mike-north ember-cookies 0.0.6 26e7122
@marcoow marcoow fix config for fastboot 1b410cf
@marcoow marcoow never abort current transition in FastBoot 10b91b4
@marcoow marcoow don't abort transitions in FastBoot 8ee5abc
@arjansingh @marcoow arjansingh Fastboot Feature Branch (#1032)
* ignore store events while the session is busy (#965)

* 1.1.0-beta.5

* 1.1.0

* Check for resourceName in response in Devise Authenticator

* change cookie default key names to be rfc2616 compliant (#978)

fixes #977

* Test for session service data being set with Ember.set (#972)

* code/docs cleanup

* Add tokenRefreshOffset property to OAuth2PasswordGrantAuthenticator (#840)

tokenRefreshOffset determines the offset seconds before the token
expiration to refresh the token. This is randomized so as to reduce
race conditions between multiple tabs from refreshing at the same time.

This is configurable because in some cases, the offset randomization
needs to be increased to decrease the probability of the above mentioned
race conditions.

Once more case would be in slow internet connections, you make a call to
refresh the token but the server doesn't process it in time (or receive
it in time), the server will check and the token that you sent up is now
expired so the refresh will fail.

* cleanup transition usage in authenticated and unauthenticated route mixins (#992)

no issue
- fixes potential test timing issue
- removes unecessary abort call

* [BUGFIX] Remove Ember.Logger (#993)

Ember.Logger is not substituted by noops in production.

More info in emberjs/guides#1467

* [WIP] Validate server responses in authenticators (#957)

* Validate response data in devise authenticator

* Validate response data in OAuth2 authenticator

* Add tests for oauth2 data validations

* Add tests for devise data validations

* Remove unncessary validations

* Refactor 'restore' in devise authenticator

* Fix test timeout errors

* Minor cleanup

* Consider resource name when validating response

* Refactor devise authenticator _validate method

* update dependencies (#1004)

This updates Ember, Ember Data, Ember CLI etc. to the latest
versions. This also fixes a lot of JSCS warnings that were introduced
by the latest version of ember-suave.

* Use the term "squash" when referring to collapsing commits into one (#1011)

That's consistent with the term used in git-rebase and with the general public.

* Add rejectWithXhr to optionally reject with XHR vs response body (#1012)

Allows ember apps using ember-simple-auth to receive the whole XHR object if the backend fails, instead of the response body, if they so choose.

In the case of OAuth 2.0 backends, it's been a pattern in the wild to use X- headers to send context as to why a grant has failed. Examples include API throttling, brute force lockouts, and OTP/two-factor authentication information.

Selfishly, I require this change so my application can be notified when the API has locked out an account due to suspicious activity via an X- header.

The decision to expose it as an option was chosen so backwards compatibility is maintained and keeps the addon simple for those who need not be concerned with complex backends.

* Add fastboot-dist to npmignore (#1015)

* Optionally send custom headers in authentication call (#1018)

Complex systems that offer Two Factor Authentication with their OAuth 2.0 implementation need to send additional context via the HTTP headers. This pattern has been observed in the wild by such systems such as GitHub. Because of the restrictions of OAuth 2.0 RFC, only headers can be used for additional context, not request/response bodies.

This could be seen as a counterpart to #1012, where using both features allow bi-directional context enabling 2FA, brute force lockouts, etc.

* [fastboot-compatibility] initial work

* [fastboot-compatbility] improve support

* [fastboot-compatibility] Use ember-cookies@0.0.7

ember-cookies 0.0.6

ember-cookies@0.0.7

* [fastboot-compatbility] fix ember-build-cli.js

* [fastboot-compatibility] fix route mixin transitions

* [fastboot-compatibility] Update `session-stores/cookie` with `typeof` guard (#1)

* [fastboot-compatiblity] fix tests

* Use apiHost config for dummy app.

better name for api host conf setting

fix dummy app API endpoints

* Helpful instructions for `npm run fastboot`

* Restore cookie session renewal

* Fix various rebase issues

* ember-cli-fasboot@1.0.0-beta.7
bdd956c
@josemarluedke @marcoow josemarluedke Fix tests for fastboot feature branch (#1034) b5b2234
@marcoow marcoow fix my messed up rebase 😳 54476e1
@marcoow marcoow fix cookie store 68d2d0c
@josemarluedke @marcoow josemarluedke [Fastboot] Remove inject of cookies in initializer; Bump ember-cookie…
…s; Add fastboot host whitelist (#1039)

* Add fastboot host whitelist

* Bump ember-cookies to make dummy app work

* Remove inject of cookies in initializers
6a341d6
@josemarluedke @marcoow josemarluedke [Fastboot] Integration testing for fastboot (#1045)
* Add session register back

* Create a fastboot test app and create basic tests against fastboot.
2bd16a7
@marcoow marcoow fix bad merge 😞
7f58765
@marcoow marcoow I suck at merging 😱
e37de31
@marcoow marcoow we might need to cleanup for the node tests…
7e822c0
@marcoow marcoow run both node test and FastBoot node test
d733874
@marcoow marcoow fix node tests
0fa628c
@marcoow marcoow increase timeout for fastboot node tests
407a095
@marcoow marcoow Update OAuth2PasswordGrant Authenticator to use Fetch (#1066)
* Using ember-network fetch for the oauth2 password grand authenticator

* Fixing unit tests for adding fetch to ember simple auth

* Changing naming of rejectWithRequest to rejectWithResponse

* Making rejectWithXhr a deprecatingAlias and adding import-polyfill to the node-tests app

* docs fixes
fa949b3
@simonihmig

Would you consider using ember-fastboot-addon-tests for the Fastboot tests? It would dry up the tests and remove some boilerplate code. Should be fairly easy to do, as the implementation is pretty similar. I could put a PR together if there are no objections! :)

@marcoow
Member
marcoow commented Nov 11, 2016

@simonihmig: not sure what ember-fastboot-addon-tests would simplify, can you elaborate? At this point I'm a bit hesitant to add more changes onto this as this has been open for quite some time already. that said, adding ember-fastboot-addon-tests could always be done after the initial 1.2 beta release of course.

@simonihmig

It would probably remove the need for these files or parts of them:

This is just a minor optimization, and should certainly not block the release of 1.2 in any way. So if you feel better doing this afterwards, that would be fine as well!

@marcoow
Member
marcoow commented Nov 11, 2016

Yeah, let's look at that again after the 1.2 beta release

@simonihmig

@marcoow No problem. Just added #1097 to not forget about this. Looking forward to 1.2 myself! :)

@lolmaus
Contributor
lolmaus commented Nov 21, 2016

Hi!

I'm building a FastBoot app and I successfully added GitHub auth with ESA, Torii and Gatekeeper. But I discovered that ESA 1.1.0 completely prevents static HTML from generating! The HTML file ends up just like it would without FastBoot.

So I tried ESA fastboot branch and ran into issues.

First of all, it crashed on [this line] with _fastboot.request.host being undefined.

Also, looking at this code I saw another problem: it's incorrect to search for protocol name in request.host because according to FastBoot docs that property only contains the hostname.

I only want HTML for anonymous users to be generated, so I tried switching to the localStorage session store. When I updated the restore method to return a prerejected promise in case of isFastBoot, FastBoot started generating HTML correctly.

But on the fastboot branch there appeared another crazy problem: in a controller, model comes as null! I return an RSVP.hash from the route's model hook, but it ends up null. Simply removing ESA-fastboot from package.json resolves that issue.

@stevenwu @marcoow stevenwu Merge branch 'master' into fastboot (#1098)
* Merge branch 'master' into fastboot

* Remove unneeded test

* Refactor to use ember-cookies clear()

* Try fix for 1.12

* Cleanup
3def912
@lolmaus
Contributor
lolmaus commented Nov 22, 2016

OK, I figured out the null model.

It happens because I short-circuit my localStorage adapter in FastBoot mode, having it return a prerejected projmise. According to documentation, this is valid behavior:

@return {Ember.RSVP.Promise} A promise that resolves with the data currently persisted in the store when the data has been restored successfully and rejects otherwise.

When I replaced the short circuit to returning a preresolved model instead of prerejected, the problem is gone: model resolves just fine.

This issue may be related to [this code], even though on a second thought it shouldn't cause this effect:

  applicationRoute.reopen({
    beforeModel() {
      return session.restore().then(
        () => applyOriginalBeforeModel(...arguments),
        () => applyOriginalBeforeModel(...arguments)
      );
    }
  });
@marcoow
Member
marcoow commented Nov 23, 2016

@lolmaus: what does the model method look like for the route that the model is null for? Are you using the DataAdapterMixin in the respective adapter?

@lolmaus
Contributor
lolmaus commented Nov 23, 2016

@marcoow

  1. https://github.com/lolmaus/lolma.us/blob/1cf778c53d2ee1601843cf7452d985e8e608aaf4/app/pods/locale/route.js#L28-L55
  2. No, I'm using the base ember-data/adapter driven by ember-network/fetch.

It's very weird that the model returns as null without error. I return RSVP.hash from the model hook, so the model should always be a promise even if there was a crash inside the promise.

@lolmaus
Contributor
lolmaus commented Nov 23, 2016

@marcoow So what? If any (or even all) child promises fail, the resulting promise will still be a promise. It will never turn into null.

@marcoow
Member
marcoow commented Nov 23, 2016

This will reject when you're not running on FastBoot. I'm not sure what a subsequent call to modelFor will result in.

@lolmaus
Contributor
lolmaus commented Nov 23, 2016

@marcoow Everything is fine in non-FastBoot mode. The problem happens in FastBoot mode.

And again: even if it rejects, I should see a (rejected) promise in controller's model property. This is true when there's no ESA in the project. Adding ESA fastboot branch turns the model in controller into null.

@lolmaus
Contributor
lolmaus commented Nov 23, 2016

PS I'm available in Ember Slack in ESA channel.

@lolmaus
Contributor
lolmaus commented Nov 23, 2016

Filed #1104 to address the cookie store trying to find protocol name in the host property.

lolmaus and others added some commits Nov 24, 2016
@lolmaus @marcoow lolmaus Cookie store `_secureCookies`: use correct protocol property in FastB…
…oot mode (#1104)
39e08b0
@stevenwu @marcoow stevenwu Merge latest master into fastboot (#1110)
* Update managing-current-user.md (#1068)

Avoid making a current user request if not authenticated

* Add explanatory comment to application route (#1069)

The setup-session-restoration initializer needs the application route to be explicitly defined in the consuming app, so simple auth must ship with this file in case the consuming app hasn't defined their own. However, if the consuming app has another addon that also provides an application route via it's app folder, simple auth may override that addon's file with this one, depending on the load order.

This is easily fixed by specifying an explicit load order (i.e. `after: 'ember-simple-auth'`). However, because the contents of this file are completely generic, and Ember's build process merges this file into the app folder without retaining source information, it's difficult to know from the consuming app's perspective that simple-auth is the addon providing this generic file (and therefore the `after` option needs to specify "ember-simple-auth").

This adds an explanatory comment, hopefully making it a bit clearer in case anyone is trying to figure out where this empty application route file is coming from.

* Cookie store rewrite (#1056)

* Persist to cookie when relevant attributes change

* Refactor cookie properties on adaptive store

* Fix cookie store getters and setters

* Fix adaptive store test

* Remove unused code

* Fix cookie properties on adaptive store

* Change cookie properties to adaptive store

* Fix cookie setters

* Fix jshint errors

* Remove unused code

* Wrap `rewriteCookie` in Ember.run.scheduleOnce

* Remove extra run.scheduleOnce

* Remove unnecessary jshint ignores

* Minor cleanup

* Fix cookie domain test

* Add tests for rewrite behavior

* Save WIP on shared cookie behavior

* fix cookie store rewrite behavior tests

* Small fixes (#1047)

* Fix jshint error

* Allow cookie to write blank values on clear

* Restore previous cookieDomain test

* Persist value in test so cookie will write

* Fix cookie domain test

* simplify AdaptiveStore code

* simplify cooke store code

* use CPs consistently internally

* code cleanup

* handle changes of cookie name correctly

* no need to clear before rewrite

* clear old expiration cookie as well

* Include path when deleting cookie (#1067)

* Refactor cookie string (#1074)

* Include path when deleting cookie

* Add a cookie string method

* Should `resolve` after fetching user. (#1077)

* Should `resolve` after fetching user.

Else the promise remains unresolved.

* Remove return as suggested in the review

* Remove yet another return as suggested

* Update "ember-cli-mocha" to v0.12.0 (#1105)

* Update "ember-cli-mocha" to v0.12.0

* tests: Import it() from "mocha"

* tests: Use new testing API in ember-mocha

* Fix OAuth2 authenticator tokenRefreshOffset (#1106)

* Fix OAuth2 authenticator tokenRefreshOffset

* Fix lint mistake

* Ensure correct root url handling (#1070)

* set rootURL on router correctly

* document readonly correctly

* use rootURL if present

* Fix typo (#1109)
de6ddcb
@marcoow marcoow Merge branch 'master' into fastboot
0982985
@marcoow marcoow cleanup 7fc5fec
@marcoow marcoow remove unnecessary injection 3ba566c
@marcoow marcoow remove unnecessary property 91f972c
@marcoow marcoow fix dependency versions
d07f8ee
@marcoow marcoow use cookie session store in dummy app
a72a753
@marcoow marcoow merged commit 75cd83b into master Dec 6, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@marcoow marcoow deleted the fastboot branch Dec 6, 2016
@lolmaus
Contributor
lolmaus commented Dec 6, 2016

🙀 🍾

@josemarluedke

🎉 🍾 🎉🎉🎉

@marcoow
Member
marcoow commented Dec 6, 2016

Thanks for the great work everyone! Will publish and announce tomorrow.

@olleolleolle olleolleolle added a commit to olleolleolle/ember-simple-auth that referenced this pull request Dec 7, 2016
@marcoow @olleolleolle marcoow + olleolleolle FastBoot Compatibility (#1035)
* DRAFT - Fastboot compatibility

* improve fastboot support

* add FastBoot info to README

* fix tests

* better name for api host conf setting

* WIP: fixing tests

* fix tests

* Use version of ember-cookies with fix for fasboot

* ember-cookies 0.0.6

* fix config for fastboot

* never abort current transition in FastBoot

* don't abort transitions in FastBoot

* Fastboot Feature Branch (#1032)

* ignore store events while the session is busy (#965)

* 1.1.0-beta.5

* 1.1.0

* Check for resourceName in response in Devise Authenticator

* change cookie default key names to be rfc2616 compliant (#978)

fixes #977

* Test for session service data being set with Ember.set (#972)

* code/docs cleanup

* Add tokenRefreshOffset property to OAuth2PasswordGrantAuthenticator (#840)

tokenRefreshOffset determines the offset seconds before the token
expiration to refresh the token. This is randomized so as to reduce
race conditions between multiple tabs from refreshing at the same time.

This is configurable because in some cases, the offset randomization
needs to be increased to decrease the probability of the above mentioned
race conditions.

Once more case would be in slow internet connections, you make a call to
refresh the token but the server doesn't process it in time (or receive
it in time), the server will check and the token that you sent up is now
expired so the refresh will fail.

* cleanup transition usage in authenticated and unauthenticated route mixins (#992)

no issue
- fixes potential test timing issue
- removes unecessary abort call

* [BUGFIX] Remove Ember.Logger (#993)

Ember.Logger is not substituted by noops in production.

More info in emberjs/guides#1467

* [WIP] Validate server responses in authenticators (#957)

* Validate response data in devise authenticator

* Validate response data in OAuth2 authenticator

* Add tests for oauth2 data validations

* Add tests for devise data validations

* Remove unncessary validations

* Refactor 'restore' in devise authenticator

* Fix test timeout errors

* Minor cleanup

* Consider resource name when validating response

* Refactor devise authenticator _validate method

* update dependencies (#1004)

This updates Ember, Ember Data, Ember CLI etc. to the latest
versions. This also fixes a lot of JSCS warnings that were introduced
by the latest version of ember-suave.

* Use the term "squash" when referring to collapsing commits into one (#1011)

That's consistent with the term used in git-rebase and with the general public.

* Add rejectWithXhr to optionally reject with XHR vs response body (#1012)

Allows ember apps using ember-simple-auth to receive the whole XHR object if the backend fails, instead of the response body, if they so choose.

In the case of OAuth 2.0 backends, it's been a pattern in the wild to use X- headers to send context as to why a grant has failed. Examples include API throttling, brute force lockouts, and OTP/two-factor authentication information.

Selfishly, I require this change so my application can be notified when the API has locked out an account due to suspicious activity via an X- header.

The decision to expose it as an option was chosen so backwards compatibility is maintained and keeps the addon simple for those who need not be concerned with complex backends.

* Add fastboot-dist to npmignore (#1015)

* Optionally send custom headers in authentication call (#1018)

Complex systems that offer Two Factor Authentication with their OAuth 2.0 implementation need to send additional context via the HTTP headers. This pattern has been observed in the wild by such systems such as GitHub. Because of the restrictions of OAuth 2.0 RFC, only headers can be used for additional context, not request/response bodies.

This could be seen as a counterpart to #1012, where using both features allow bi-directional context enabling 2FA, brute force lockouts, etc.

* [fastboot-compatibility] initial work

* [fastboot-compatbility] improve support

* [fastboot-compatibility] Use ember-cookies@0.0.7

ember-cookies 0.0.6

ember-cookies@0.0.7

* [fastboot-compatbility] fix ember-build-cli.js

* [fastboot-compatibility] fix route mixin transitions

* [fastboot-compatibility] Update `session-stores/cookie` with `typeof` guard (#1)

* [fastboot-compatiblity] fix tests

* Use apiHost config for dummy app.

better name for api host conf setting

fix dummy app API endpoints

* Helpful instructions for `npm run fastboot`

* Restore cookie session renewal

* Fix various rebase issues

* ember-cli-fasboot@1.0.0-beta.7

* Fix tests for fastboot feature branch (#1034)

* fix my messed up rebase 😳

* fix cookie store

* [Fastboot] Remove inject of cookies in initializer; Bump ember-cookies; Add fastboot host whitelist (#1039)

* Add fastboot host whitelist

* Bump ember-cookies to make dummy app work

* Remove inject of cookies in initializers

* [Fastboot] Integration testing for fastboot (#1045)

* Add session register back

* Create a fastboot test app and create basic tests against fastboot.

* fix bad merge 😞

* I suck at merging 😱

* we might need to cleanup for the node tests…

* run both node test and FastBoot node test

* fix node tests

* increase timeout for fastboot node tests

* Update OAuth2PasswordGrant Authenticator to use Fetch (#1066)

* Using ember-network fetch for the oauth2 password grand authenticator

* Fixing unit tests for adding fetch to ember simple auth

* Changing naming of rejectWithRequest to rejectWithResponse

* Making rejectWithXhr a deprecatingAlias and adding import-polyfill to the node-tests app

* docs fixes

* don't bind to localStorage events in FastBoot

* fix test

* don't use window.location in fastboot

* update docs for fastboot

* use ember-network in devise authenticator

* fix tests

* rename fastboot app fixture

* rename fastboot test

* WIP: FastBoot regression test

* WIP: FastBoot regression test

* fix adaptive store for fastboot

* Merge branch 'master' into fastboot (#1098)

* Merge branch 'master' into fastboot

* Remove unneeded test

* Refactor to use ember-cookies clear()

* Try fix for 1.12

* Cleanup

* Cookie store `_secureCookies`: use correct protocol property in FastBoot mode (#1104)

* Merge latest master into fastboot (#1110)

* Update managing-current-user.md (#1068)

Avoid making a current user request if not authenticated

* Add explanatory comment to application route (#1069)

The setup-session-restoration initializer needs the application route to be explicitly defined in the consuming app, so simple auth must ship with this file in case the consuming app hasn't defined their own. However, if the consuming app has another addon that also provides an application route via it's app folder, simple auth may override that addon's file with this one, depending on the load order.

This is easily fixed by specifying an explicit load order (i.e. `after: 'ember-simple-auth'`). However, because the contents of this file are completely generic, and Ember's build process merges this file into the app folder without retaining source information, it's difficult to know from the consuming app's perspective that simple-auth is the addon providing this generic file (and therefore the `after` option needs to specify "ember-simple-auth").

This adds an explanatory comment, hopefully making it a bit clearer in case anyone is trying to figure out where this empty application route file is coming from.

* Cookie store rewrite (#1056)

* Persist to cookie when relevant attributes change

* Refactor cookie properties on adaptive store

* Fix cookie store getters and setters

* Fix adaptive store test

* Remove unused code

* Fix cookie properties on adaptive store

* Change cookie properties to adaptive store

* Fix cookie setters

* Fix jshint errors

* Remove unused code

* Wrap `rewriteCookie` in Ember.run.scheduleOnce

* Remove extra run.scheduleOnce

* Remove unnecessary jshint ignores

* Minor cleanup

* Fix cookie domain test

* Add tests for rewrite behavior

* Save WIP on shared cookie behavior

* fix cookie store rewrite behavior tests

* Small fixes (#1047)

* Fix jshint error

* Allow cookie to write blank values on clear

* Restore previous cookieDomain test

* Persist value in test so cookie will write

* Fix cookie domain test

* simplify AdaptiveStore code

* simplify cooke store code

* use CPs consistently internally

* code cleanup

* handle changes of cookie name correctly

* no need to clear before rewrite

* clear old expiration cookie as well

* Include path when deleting cookie (#1067)

* Refactor cookie string (#1074)

* Include path when deleting cookie

* Add a cookie string method

* Should `resolve` after fetching user. (#1077)

* Should `resolve` after fetching user.

Else the promise remains unresolved.

* Remove return as suggested in the review

* Remove yet another return as suggested

* Update "ember-cli-mocha" to v0.12.0 (#1105)

* Update "ember-cli-mocha" to v0.12.0

* tests: Import it() from "mocha"

* tests: Use new testing API in ember-mocha

* Fix OAuth2 authenticator tokenRefreshOffset (#1106)

* Fix OAuth2 authenticator tokenRefreshOffset

* Fix lint mistake

* Ensure correct root url handling (#1070)

* set rootURL on router correctly

* document readonly correctly

* use rootURL if present

* Fix typo (#1109)

* cleanup

* remove unnecessary injection

* remove unnecessary property

* fix dependency versions

* use cookie session store in dummy app
6f15764
@@ -72,7 +79,11 @@ export default Mixin.create({
let authenticationRoute = this.get('authenticationRoute');
assert('The route configured as Configuration.authenticationRoute cannot implement the AuthenticatedRouteMixin mixin as that leads to an infinite transitioning loop!', this.get('routeName') !== authenticationRoute);
- this.set('session.attemptedTransition', transition);
+ if (!this.get('_isFastBoot')) {
+ transition.abort();
@juanazam
juanazam Dec 8, 2016 Contributor

Hey, It seems that transition.abort call was re added when a recent pull request deleted it (#992) , is this intended?

I'm asking because that transition.abort() call was giving me trouble and I was waiting for the new release to be corrected.

@marcoow
marcoow Dec 9, 2016 Member

Right - that looks like it accidentally got re-added with the FastBoot merge. Want to submit a PR that removes it again?

@juanazam
juanazam Dec 9, 2016 Contributor

Submitted: #1126 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment