1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-08 23:15:29 +02:00

save valid token to js meta

This commit is contained in:
Elliott Stoneham 2016-07-05 17:03:18 +01:00
parent ede91fa58a
commit 19df71685f
2 changed files with 433 additions and 431 deletions

View file

@ -64,6 +64,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
config.branchLines = metaConfig.branchLines;
config.state = metaConfig.state;
config.issues = metaConfig.issues;
config.token = metaConfig.token;
} catch (e) {}
self.set('config', config);
@ -84,7 +85,8 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
});
} else {
self.get('sectionService').fetch(page, "check_token", self.get('config'))
.then(function () {
.then(function (cfg) {
self.set('config.token', cfg.token);
console.log("github auth code valid");
self.send('authStage2');
}, function (error) { //jshint ignore: line

View file

@ -136,7 +136,7 @@ func (p *Provider) Command(w http.ResponseWriter, r *http.Request) {
provider.WriteError(w, "github", err)
return
}
provider.WriteEmpty(w)
provider.WriteJSON(w, config)
return
default: