fidor_starter_kits 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 385c43541dc48c1da99e20d60343799b235029da
|
4
|
+
data.tar.gz: 31041d4908acaa21af5276df0930cc4681e6ab07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48ebf73bf2cfa9b42a595c75e214b73b851b6a04c931635f9517d834159f515c5f484ef6d6abdd036b34fa0dc3db5589746f9ee60630a3c0c7231ce860bdc825
|
7
|
+
data.tar.gz: 7b2f60e6dd06aace2defa0ed5de47fa1fbc782cf529cb35199616b4c42cbad1e43a67ae73eedec59956562290ab6d12ceb6e1776f81828abbffb36d601f90dae
|
@@ -101,7 +101,7 @@ func retrieveTokenFromCode(code string) (token string, err error) {
|
|
101
101
|
"client_secret": {client_secret},
|
102
102
|
"code": {code},
|
103
103
|
"redirect_uri": {url.QueryEscape(oauth_cb_url)},
|
104
|
-
"grant_type": {"
|
104
|
+
"grant_type": {"authorization_code"},
|
105
105
|
}
|
106
106
|
// Call API
|
107
107
|
if resp, err := http.PostForm(tokenUrl, tokenPayload); err != nil {
|
@@ -14,7 +14,6 @@
|
|
14
14
|
// manager an need to be transfered into the config below:
|
15
15
|
|
16
16
|
var fidor_config = {
|
17
|
-
app_port : 3001,
|
18
17
|
app_url : "<APP_URL>",
|
19
18
|
client_id : "<CLIENT_ID>",
|
20
19
|
client_secret : "<CLIENT_SECRET>",
|
@@ -22,6 +21,8 @@ var fidor_config = {
|
|
22
21
|
}
|
23
22
|
|
24
23
|
|
24
|
+
|
25
|
+
|
25
26
|
// redirect the user to the OAuth authorization endpoint with the
|
26
27
|
// following params:
|
27
28
|
// - client_id
|
@@ -39,7 +40,7 @@ function redirect_to_oauth(response){
|
|
39
40
|
return
|
40
41
|
}
|
41
42
|
|
42
|
-
|
43
|
+
// Execute a POST request against the OAUTH token endpoint
|
43
44
|
// in order to exchange: code, client_id, client_secret,
|
44
45
|
// rerdirect_uri and grant_type for an auth_token.
|
45
46
|
function retrieve_access_token_from_code( code, cb ) {
|
@@ -85,7 +86,7 @@ function retrieve_access_token_from_code( code, cb ) {
|
|
85
86
|
token_request.end()
|
86
87
|
}
|
87
88
|
|
88
|
-
|
89
|
+
|
89
90
|
// Display a friendly message and links to the API Endpoints.
|
90
91
|
function renderWelcome(request, response, token) {
|
91
92
|
response.writeHead(200, {"Content-Type" : "text/html"})
|
@@ -126,6 +127,9 @@ var url = require("url")
|
|
126
127
|
var querystring = require("querystring")
|
127
128
|
var http = require("http")
|
128
129
|
|
130
|
+
var _url = url.parse(fidor_config.app_url)
|
131
|
+
fidor_config.app_port = _url.port
|
132
|
+
|
129
133
|
// start the server
|
130
134
|
var server = http.createServer(listener)
|
131
135
|
server.listen(fidor_config.app_port)
|