Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-spotify-oauth

Package Overview
Dependencies
Maintainers
1
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.0 to 0.1.1

2

package.json
{
"name": "cordova-spotify-oauth",
"version": "0.1.0",
"version": "0.1.1",
"description": "Cordova plugin for authenticating with Spotify",

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

@@ -35,2 +35,15 @@ import 'whatwg-fetch';

/**
* Safety margin time (in milliseconds) for the token refresh.
*
* The plugin applies a safety margin to the token lifetime in order
* to give the token user enough time to perform all operations needed.
*
* Otherwise the plugin might hand out a token that is already expired
* before it could ever be used.
*
* The safety margin defaults to 30s.
*/
refreshSafetyMargin?: number;
/** Requested OAuth scopes. */

@@ -79,2 +92,5 @@ scopes: string[];

}
if ((cfg.refreshSafetyMargin || 0) < 0) {
throw new Error("safety margin < 0");
}

@@ -86,3 +102,6 @@ const lsData = localStorage.getItem(LOCAL_STORAGE_KEY);

const expiry = Date.now() + 60 * 5 * 1000; // 5min margin
const margin = (cfg.refreshSafetyMargin != undefined)
? cfg.refreshSafetyMargin
: 30000;
const expiry = Date.now() + margin;
if (authData.expiresAt > expiry) {

@@ -89,0 +108,0 @@ return Promise.resolve(authData);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc