mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-01 20:22:29 +00:00
added ability to connect github development id to cloud cmd working on any host
This commit is contained in:
parent
347bd9e5c8
commit
0fda72a425
4 changed files with 37 additions and 5 deletions
|
|
@ -7,7 +7,9 @@ var CloudCommander, Util, DOM, $, Github, cb;
|
|||
|
||||
var cloudcmd = CloudCommander,
|
||||
|
||||
API_URL = '/api/v1/auth',
|
||||
APIURL = '/api/v1',
|
||||
AuthURL = APIURL + '/auth',
|
||||
ClientIdURL = APIURL + '/client_id',
|
||||
CLIENT_ID,
|
||||
Cache = DOM.Cache,
|
||||
GitHub,
|
||||
|
|
@ -41,12 +43,22 @@ var CloudCommander, Util, DOM, $, Github, cb;
|
|||
}
|
||||
|
||||
function setConfig(pCallBack){
|
||||
/*
|
||||
cloudcmd.loadConfig(function(){
|
||||
var lConfig = cloudcmd.Config;
|
||||
CLIENT_ID = lConfig.oauth_client_id;
|
||||
|
||||
Util.exec(pCallBack);
|
||||
});
|
||||
*/
|
||||
|
||||
DOM.ajax({
|
||||
url : ClientIdURL,
|
||||
success : function(pData){
|
||||
CLIENT_ID = pData;
|
||||
Util.exec(pCallBack);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function saveToken(pToken){
|
||||
|
|
@ -89,7 +101,7 @@ var CloudCommander, Util, DOM, $, Github, cb;
|
|||
|
||||
DOM.ajax({
|
||||
type : 'put',
|
||||
url : API_URL,
|
||||
url : AuthURL,
|
||||
data: lCode,
|
||||
success: function(pData){
|
||||
if(pData && pData.token){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue