import Ember from 'ember';

import UnauthenticatedRouteMixin from 'ember-simple-auth/mixins/unauthenticated-route-mixin';
import OsfTokenLoginRouteMixin from 'ember-osf/mixins/osf-token-login-route';

// Sample login page. After successful login, user will be taken to the site homepage
export default Ember.Route.extend(UnauthenticatedRouteMixin, OsfTokenLoginRouteMixin, {
    beforeModel() {
        // TODO: Possible bug situation: since error isn't reraised in mixin, this may send user to homepage even if log fails
        return this._super().then(() => this.transitionTo('index'));
    }
});

@@ -527,14 +527,19 @@
     
-return
+const res =
  thi
@@ -548,16 +548,201 @@
 _super()
+;%0A        if (res) %7B%0A            // Slightly inelegant hack: If yanking to another page, there will be no return value from super. If auth succeeded, transition to home.%0A            res
 .then(()
@@ -774,16 +774,26 @@
 dex'));%0A
+        %7D%0A
     %7D%0A%7D)

Fix login redirect behavior