diff --git a/app/app/components/section/github/type-editor.js b/app/app/components/section/github/type-editor.js index 18932bdf..a07327d5 100644 --- a/app/app/components/section/github/type-editor.js +++ b/app/app/components/section/github/type-editor.js @@ -86,9 +86,9 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, self.send('auth'); }); } else { - if (config.userId !== self.session.user.id) { + if (config.userId !== self.get("session.session.authenticated.user.id")) { console.log("github auth wrong user ID, switching"); - self.set('config.userId', self.session.user.id); + self.set('config.userId', self.get("session.session.authenticated.user.id")); } self.get('sectionService').fetch(page, "checkAuth", self.get('config')) .then(function () { @@ -361,7 +361,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, authStage2() { let self = this; - self.set('config.userId', this.session.user.id); + self.set('config.userId', self.get("session.session.authenticated.user.id")); self.set('authenticated', true); self.set('busy', true); let page = this.get('page'); diff --git a/app/app/components/section/papertrail/type-editor.js b/app/app/components/section/papertrail/type-editor.js index 31009ff9..c3245eb7 100644 --- a/app/app/components/section/papertrail/type-editor.js +++ b/app/app/components/section/papertrail/type-editor.js @@ -65,12 +65,12 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, }, auth() { - console.log(this.get('config')); // missing data? this.set('config.APIToken', this.get('config.APIToken').trim()); if (is.empty(this.get('config.APIToken'))) { $("#papertrail-apitoken").addClass("error").focus(); + console.log("auth token empty"); return; } @@ -85,6 +85,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, self.set('authenticated', true); self.set('items', response); self.set('config.APIToken', '********'); // reset the api token once it has been sent to the host + console.log("auth token OK"); self.get('sectionService').fetch(page, "options", config) .then(function (response) { @@ -97,15 +98,18 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin, Ember.set(config, 'group', group); } }, function (reason) { //jshint ignore: line + self.set('authenticated', false); self.set('waiting', false); + self.set('config.APIToken', ''); // clear the api token self.displayError(reason); + console.log("get options call failed"); }); }, function (reason) { //jshint ignore: line self.set('authenticated', false); self.set('waiting', false); self.set('config.APIToken', ''); // clear the api token self.displayError(reason); - $("#papertrail-apitoken").addClass("error").focus(); + console.log("auth token invalid"); }); }, diff --git a/app/app/templates/components/section/papertrail/type-editor.hbs b/app/app/templates/components/section/papertrail/type-editor.hbs index a4759032..4ca4ad77 100644 --- a/app/app/templates/components/section/papertrail/type-editor.hbs +++ b/app/app/templates/components/section/papertrail/type-editor.hbs @@ -2,25 +2,27 @@