mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
refactor(github) auth
This commit is contained in:
parent
6d84f734d2
commit
8ac1cc5837
4 changed files with 36 additions and 29 deletions
|
|
@ -2,24 +2,21 @@
|
|||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<script src="/cloudcmd/join:lib/promise.js:lib/util.js:lib/client/dom.js:lib/client/events.js:lib/client/load.js:lib/client/files.js:lib/client.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var opener = window.opener;
|
||||
|
||||
if (opener) {
|
||||
DOM.Files.get('modules', function(error, modules) {
|
||||
var Util = opener.Util,
|
||||
Storage = Util.findObjByNameInArr(modules, 'storage'),
|
||||
GitHub = Util.findObjByNameInArr(Storage, 'GitHub'),
|
||||
GitHub_ID = GitHub && GitHub.key;
|
||||
|
||||
window.location =
|
||||
'https://github.com/login/oauth/authorize?client_id=' +
|
||||
GitHub_ID + '&&scope=repo,user,gist';
|
||||
});
|
||||
}
|
||||
DOM.Files.get('modules', function(error, modules) {
|
||||
var URL = 'https://github.com/login/oauth/authorize?client_id=',
|
||||
Storage = Util.findObjByNameInArr(modules, 'storage'),
|
||||
GitHub = Util.findObjByNameInArr(Storage, 'GitHub'),
|
||||
GitHub_ID = GitHub && GitHub.key;
|
||||
|
||||
|
||||
window.location =
|
||||
URL + GitHub_ID + '&&scope=repo,user,gist';
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue