@genezio/auth
Advanced tools
Comparing version 2.0.14-dev to 2.0.15-dev
/** | ||
* This is an auto generated code. This code should not be modified since the file can be overwritten | ||
* if new genezio commands are executed. | ||
*/ | ||
* This is an auto generated code. This code should not be modified since the file can be overwritten | ||
* if new genezio commands are executed. | ||
*/ | ||
import { Remote } from "genezio-remote"; | ||
@@ -21,2 +21,3 @@ import { UserLoginResponse, User } from "./models/UserTypes"; | ||
private static notInitializedErrorMessage; | ||
private static notLoggedInErrorMessage; | ||
private static instance; | ||
@@ -23,0 +24,0 @@ private remote; |
"use strict"; | ||
/** | ||
* This is an auto generated code. This code should not be modified since the file can be overwritten | ||
* if new genezio commands are executed. | ||
*/ | ||
* This is an auto generated code. This code should not be modified since the file can be overwritten | ||
* if new genezio commands are executed. | ||
*/ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -77,3 +77,5 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
this.instance = new AuthService(); | ||
if (typeof process !== "undefined" && process.env != null && process.env.GNZ_AUTH_FUNCTION_URL != null) { | ||
if (typeof process !== "undefined" && | ||
process.env != null && | ||
process.env.GNZ_AUTH_FUNCTION_URL != null) { | ||
var url = process.env.GNZ_AUTH_FUNCTION_URL; | ||
@@ -145,2 +147,5 @@ this.instance.remote = new genezio_remote_1.Remote(url); | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -174,2 +179,5 @@ } | ||
if (!this.remote || !this.storage) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -201,2 +209,5 @@ } | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -226,2 +237,5 @@ } | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -250,2 +264,5 @@ } | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -280,2 +297,5 @@ } | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -305,2 +325,5 @@ } | ||
if (!this.remote || !this.storage) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -331,2 +354,5 @@ } | ||
if (!this.remote || !this.storage) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -354,2 +380,5 @@ } | ||
if (!this.remote) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -367,2 +396,5 @@ } | ||
if (!this.storage) { | ||
if (process.env.LOGGED_IN_LOCAL === "false") { | ||
throw new Error(AuthService.notLoggedInErrorMessage); | ||
} | ||
throw new Error(AuthService.notInitializedErrorMessage); | ||
@@ -376,2 +408,3 @@ } | ||
AuthService.notInitializedErrorMessage = "The AuthService class was not initialized. Call AuthService.getInstance().setTokenAndRegion(token, region) with the values provided in genezio dashboard. Check <link> for more information."; | ||
AuthService.notLoggedInErrorMessage = "You must be logged in to test the Auth Service locally. Please run 'genezio login' to test the Auth Service locally."; | ||
AuthService.instance = null; | ||
@@ -378,0 +411,0 @@ return AuthService; |
{ | ||
"name": "@genezio/auth", | ||
"version": "2.0.14-dev", | ||
"version": "2.0.15-dev", | ||
"description": "SDK for accessing genezio authentication system.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
50208
842
14