Socket
Socket
Sign inDemoInstall

@auth0-kits/server

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@auth0-kits/server - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

2

package.json
{
"name": "@auth0-kits/server",
"version": "1.1.0",
"version": "1.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,3 @@ const querystring = require('querystring');

const USER_URL = '/api/v2/users/';
const LINK_ACCOUNTS_URL = '/identities';

@@ -213,4 +214,33 @@ class Auth0Service {

}
async linkAccounts(primaryAccountUserId, secondaryToken) {
this.tracer.trace('linkAccounts', { primaryAccountUserId, secondaryToken });
const body = querystring.stringify({
link_with: secondaryToken,
});
this.tracer.crumb({ body });
let response;
try {
const url = `${this.auth0TenantUrl}${USER_URL}/${primaryAccountUserId}/${LINK_ACCOUNTS_URL}`;
this.tracer.crumb({ url });
response = await fetch(url, {
method: 'POST',
body,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
});
const { headers, status, statusText } = response;
this.tracer.crumb({ headers, status, statusText });
} catch (error) {
throw this.tracer.break(error);
}
const responseJson = await response.json();
return this.tracer.dump(responseJson);
}
}
module.exports = Auth0Service;
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