@corbado/node-sdk
Advanced tools
Comparing version 1.1.10 to 1.1.11
{ | ||
"name": "@corbado/node-sdk", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"description": "This Node.js SDK eases the integration of Corbado's passkey-first authentication solution.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
@@ -23,7 +23,11 @@ import assert from 'assert'; | ||
constructor(projectID, apiSecret) { | ||
if (!projectID || !apiSecret) { | ||
throw new Error('Missing environment variables project ID and/or API secret.'); | ||
constructor(projectID, apiSecret = '') { | ||
if (!projectID.startsWith('pro-')) { | ||
throw new Error('Invalid project ID "' + projectID + '" given, needs to start with "pro-"'); | ||
} | ||
if (apiSecret !== '' && !apiSecret.startsWith('corbado1_')) { | ||
throw new Error('Invalid API secret "' + apiSecret + '" given, needs to start with "corbado1_"'); | ||
} | ||
this.#projectID = projectID; | ||
@@ -30,0 +34,0 @@ this.#apiSecret = apiSecret; |
@@ -42,6 +42,2 @@ import Passkeys from './services/passkeys.service.js'; | ||
if (this.#config.apiSecret === null) { | ||
throw new Error('No api secret set'); | ||
} | ||
this.#client = new CorbadoApi(this.#config.projectID, this.#config.apiSecret, this.#config.backendAPI) | ||
@@ -48,0 +44,0 @@ } else { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
199651
0