@toruslabs/customauth
Advanced tools
@@ -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 @@ } |
+10
-10
| { | ||
| "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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
559657
0.02%Updated
Updated