Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

cordova-spotify-oauth

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-spotify-oauth - npm Package Compare versions

Comparing version
0.1.10
to
0.1.11
+1
-1
install-ios.sh
#!/usr/bin/env bash
INSTALL_PATH="plugins/cordova-spotify-oauth/src/ios/spotify-sdk"
DOWNLOAD_PATH="https://github.com/spotify/ios-sdk/archive/beta-25.tar.gz"
DOWNLOAD_PATH="https://github.com/spotify/ios-streaming-sdk/archive/beta-25.tar.gz"

@@ -6,0 +6,0 @@ if [ ! -d $INSTALL_PATH ]; then

@@ -7,5 +7,4 @@ ---

name: aws
runtime: nodejs4.3
runtime: nodejs8.10
region: eu-central-1
profile: festify
memorySize: 128

@@ -24,2 +23,3 @@

method: post
cors: true
refreshToken:

@@ -31,1 +31,2 @@ handler: spotifyTokenService.refreshToken

method: post
cors: true

@@ -17,2 +17,15 @@ 'use strict';

// add CORS headers to response
// Reference: https://serverless.com/blog/cors-api-gateway-survival-guide/#cors-response-headers
function cors(response) {
if (response) {
const headers = response.headers || {};
headers["Access-Control-Allow-Origin"] = "*"; // Required for CORS support to work
headers["Access-Control-Allow-Credentials"] = true; // Required for cookies, authorization headers with HTTPS
response.headers = headers;
}
return response;
}
const spotifyRequest = params => {

@@ -51,3 +64,3 @@ return new Promise((resolve, reject) => {

if (!params.code) {
callback(null, {
callback(null, cors({
statusCode: 400,

@@ -57,3 +70,3 @@ body: JSON.stringify({

})
});
}));
return;

@@ -81,3 +94,3 @@ }

.then(response => {
callback(null, response);
callback(null, cors(response));
});

@@ -90,3 +103,3 @@ };

if (!params.refresh_token) {
callback(null, {
callback(null, cors({
statusCode: 400,

@@ -96,3 +109,3 @@ body: JSON.stringify({

})
});
}));
return;

@@ -118,4 +131,4 @@ }

.then(response => {
callback(null, response);
callback(null, cors(response));
});
};
{
"name": "cordova-spotify-oauth",
"version": "0.1.10",
"version": "0.1.11",
"description": "Cordova plugin for authenticating with Spotify",

@@ -5,0 +5,0 @@ "main": "www/build/spotify-oauth.min.js",

<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-spotify-oauth" version="0.1.10" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<plugin id="cordova-spotify-oauth" version="0.1.11" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-spotify-oauth</name>

@@ -4,0 +4,0 @@

@@ -66,3 +66,3 @@ # Cordova Spotify OAuth Plugin

The authorization code flow requires server code for security. These come in the form of two HTTP endpoints, one for the auth code exchange, and the other one for access token refresh. The SDK will POST `application/x-www-form-urlencoded` data and expects JSON back.
The authorization code flow requires server code for security. These come in the form of two HTTP endpoints, one for the auth code exchange, and the other one for access token refresh. The SDK will POST `application/x-www-form-urlencoded` data and expects JSON back. Ensure you have proper CORS config set up.

@@ -69,0 +69,0 @@ To easily implement them, we built a [Serverless][serverless] service for [AWS Lambda][aws-lambda] over in the [`oauth-token-api`][token-api-example] folder. Make sure you [install the Serverless Framework properly][serverless-installation]!