Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoSign in
Socket

@toruslabs/customauth

Package Overview
Dependencies
Maintainers
5
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@toruslabs/customauth - npm Package Compare versions

Comparing version
21.3.1
to
21.3.2
+17
-17
dist/lib.cjs/handlers/JwtHandler.js

@@ -53,2 +53,19 @@ 'use strict';

} = this.params.jwtParams;
if (idToken) {
const decodedToken = helpers.decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: helpers.getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
if (accessToken) {

@@ -81,19 +98,2 @@ try {

}
if (idToken) {
const decodedToken = helpers.decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: helpers.getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
throw new Error("Access/id token not available");

@@ -100,0 +100,0 @@ }

@@ -41,2 +41,19 @@ 'use strict';

} = this.params.jwtParams;
if (idToken) {
const decodedToken = helpers.decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: helpers.getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
if (accessToken) {

@@ -69,19 +86,2 @@ try {

}
if (idToken) {
const decodedToken = helpers.decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: helpers.getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
throw new Error("Access/id token not available");

@@ -88,0 +88,0 @@ }

@@ -5,3 +5,3 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';

import log from 'loglevel';
import { validateAndConstructUrl, loginToConnectionMap, padUrlString, getUserId, decodeToken } from '../utils/helpers.js';
import { validateAndConstructUrl, loginToConnectionMap, decodeToken, getUserId, padUrlString } from '../utils/helpers.js';
import AbstractLoginHandler from './AbstractLoginHandler.js';

@@ -52,2 +52,19 @@

} = this.params.jwtParams;
if (idToken) {
const decodedToken = decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
if (accessToken) {

@@ -80,19 +97,2 @@ try {

}
if (idToken) {
const decodedToken = decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
throw new Error("Access/id token not available");

@@ -99,0 +99,0 @@ }

@@ -5,3 +5,3 @@ import { get } from '@toruslabs/http-helpers';

import { UX_MODE } from '../utils/enums.js';
import { constructURL, padUrlString, getUserId, decodeToken } from '../utils/helpers.js';
import { constructURL, decodeToken, getUserId, padUrlString } from '../utils/helpers.js';
import { PopupHandler } from '../utils/PopupHandler.js';

@@ -40,2 +40,19 @@ import AbstractLoginHandler from './AbstractLoginHandler.js';

} = this.params.jwtParams;
if (idToken) {
const decodedToken = decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
if (accessToken) {

@@ -68,19 +85,2 @@ try {

}
if (idToken) {
const decodedToken = decodeToken(idToken).payload;
const {
name,
email,
picture
} = decodedToken;
return {
profileImage: picture,
name,
email,
userId: getUserId(decodedToken, this.params.authConnection, userIdField, isUserIdCaseSensitive),
authConnectionId: this.params.authConnectionId,
authConnection: this.params.authConnection,
groupedAuthConnectionId: this.params.groupedAuthConnectionId
};
}
throw new Error("Access/id token not available");

@@ -87,0 +87,0 @@ }

{
"name": "@toruslabs/customauth",
"version": "21.3.1",
"version": "21.3.2",
"description": "CustomAuth login with torus to get user private key",

@@ -37,3 +37,3 @@ "main": "dist/lib.cjs/index.js",

"@toruslabs/constants": "^15.0.0",
"@toruslabs/eccrypto": "^6.0.2",
"@toruslabs/eccrypto": "^6.2.0",
"@toruslabs/fetch-node-details": "^15.0.0",

@@ -45,3 +45,3 @@ "@toruslabs/http-helpers": "^8.1.1",

"base64url": "^3.0.1",
"bowser": "^2.11.0",
"bowser": "^2.12.1",
"deepmerge": "^4.3.1",

@@ -54,11 +54,11 @@ "events": "^3.3.0",

"@toruslabs/config": "^3.1.0",
"@toruslabs/eslint-config-typescript": "^4.1.3",
"@toruslabs/torus-scripts": "^7.1.5",
"eslint": "^9.24.0",
"@toruslabs/eslint-config-typescript": "^4.1.4",
"@toruslabs/torus-scripts": "^7.1.6",
"eslint": "^9.39.1",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"lint-staged": "^16.2.6",
"prettier": "^3.6.2",
"rimraf": "^6.1.0",
"typed-emitter": "^2.1.0",
"typescript": "^5.8.3"
"typescript": "^5.9.3"
},

@@ -65,0 +65,0 @@ "author": "Torus Labs",

Sorry, the diff of this file is too big to display