New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trusted-accounts-sdk-node

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trusted-accounts-sdk-node - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

13

dist/TrustedAccountsClient.js

@@ -0,1 +1,2 @@

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -12,4 +13,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

const qs = require('querystring');
const crypto = require('crypto');
const { URL } = require('url');
const cryptoLib = require('crypto'); // Renamed to avoid conflicts
const { URL: NodeURL } = require('url'); // Renamed to avoid conflicts
class TrustedAccountsClient {

@@ -27,3 +28,3 @@ constructor(clientId, clientSecret, redirectUri, authUrl = 'https://auth.trustedaccounts.org/oauth2/auth', tokenUrl = 'https://auth.trustedaccounts.org/oauth2/token') {

const nonce = this._generateRandomString(); // Generate a random nonce value
const authUrl = new URL(this.authUrl);
const authUrl = new NodeURL(this.authUrl);
authUrl.searchParams.append('client_id', this.clientId);

@@ -41,3 +42,3 @@ authUrl.searchParams.append('redirect_uri', this.redirectUri);

return __awaiter(this, void 0, void 0, function* () {
const parsedUrl = new URL(callbackUrl);
const parsedUrl = new NodeURL(callbackUrl);
const code = parsedUrl.searchParams.get('code');

@@ -82,3 +83,3 @@ const state = parsedUrl.searchParams.get('state');

_generateRandomString(length = 32) {
return crypto.randomBytes(length).toString('hex');
return cryptoLib.randomBytes(length).toString('hex');
}

@@ -95,4 +96,2 @@ // Helper method to decode the ID token

}
export default TrustedAccountsClient;
// For CommonJS
module.exports = TrustedAccountsClient;

@@ -0,1 +1,5 @@

declare const axios: any;
declare const qs: any;
declare const cryptoLib: any;
declare const NodeURL: any;
interface Tokens {

@@ -19,2 +23,1 @@ access_token: string;

}
export default TrustedAccountsClient;
{
"name": "trusted-accounts-sdk-node",
"type": "module",
"version": "1.2.1",
"version": "1.2.2",
"description": "A simple SDK for Trusted Accounts for NodeJS",

@@ -6,0 +5,0 @@ "main": "dist/TrustedAccountsClient.js",

const axios = require('axios');
const qs = require('querystring');
const crypto = require('crypto');
const { URL } = require('url');
const cryptoLib = require('crypto'); // Renamed to avoid conflicts
const { URL: NodeURL } = require('url'); // Renamed to avoid conflicts

@@ -32,3 +32,3 @@ interface Tokens {

const authUrl = new URL(this.authUrl);
const authUrl = new NodeURL(this.authUrl);
authUrl.searchParams.append('client_id', this.clientId);

@@ -47,3 +47,3 @@ authUrl.searchParams.append('redirect_uri', this.redirectUri);

public async handleCallback(callbackUrl: string): Promise<Tokens> {
const parsedUrl = new URL(callbackUrl);
const parsedUrl = new NodeURL(callbackUrl);
const code = parsedUrl.searchParams.get('code');

@@ -91,3 +91,3 @@ const state = parsedUrl.searchParams.get('state');

private _generateRandomString(length: number = 32): string {
return crypto.randomBytes(length).toString('hex');
return cryptoLib.randomBytes(length).toString('hex');
}

@@ -107,5 +107,2 @@

export default TrustedAccountsClient;
// For CommonJS
module.exports = TrustedAccountsClient;
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