personium / app-myboard

An application that runs on the home application. Sample memo app.
Apache License 2.0
2 stars 6 forks source link

Content-type is set twice and an error occurs #53

Closed csKyou closed 6 years ago

csKyou commented 6 years ago
personium.getAppAuthUserToken = function(query, token) {
        var cellUrl = query.cellUrl;
        var url = [
            cellUrl,
            "__token"
        ].join("");
        var headers = {
            "Accept": "application/json",
            "content-type": "application/x-www-form-urlencoded"
        };
        var contentType = "application/json";
        var body = [
            "grant_type=authorization_code",
            "code=" + query.code,
            "client_id=" + personium.getAppCellUrl(),
            "client_secret=" + token
        ].join('&');
        var httpCodeExpected = 200;

        return personium.httpPOSTMethod(url, headers, contentType, body, httpCodeExpected);
    };