New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

polyfire-js

Package Overview
Dependencies
Maintainers
3
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

polyfire-js - npm Package Compare versions

Comparing version 0.2.41 to 0.2.42

4

auth.d.ts

@@ -54,5 +54,5 @@ import { ClientOptions } from "./clientOpts";

endpoint: string;
}): Promise<boolean>;
}, autoLogin?: boolean): Promise<boolean>;
export type AuthClient = {
init: () => Promise<boolean>;
init: (autoLogin?: boolean) => Promise<boolean>;
login: (input: LoginFunctionInput) => Promise<void>;

@@ -59,0 +59,0 @@ logout: () => Promise<void>;

@@ -279,3 +279,4 @@ "use strict";

exports.logout = logout;
function init(co, projectOptions) {
function init(co, projectOptions, autoLogin) {
if (autoLogin === void 0) { autoLogin = true; }
return __awaiter(this, void 0, void 0, function () {

@@ -287,2 +288,5 @@ var e_3, session;

_a.trys.push([0, 2, , 4]);
if (!autoLogin) {
throw new error_1.PolyfireError("Auto login disabled");
}
return [4 /*yield*/, signInAnon(undefined, co, projectOptions)];

@@ -318,3 +322,3 @@ case 1:

return {
init: function () { return init(co, projectOptions); },
init: function (autoLogin) { return init(co, projectOptions, autoLogin); },
login: function (input) { return login(input, projectOptions, co); },

@@ -321,0 +325,0 @@ logout: function () { return logout(co); },

import { ReactNode, JSX } from "react";
import { Client } from "../client";
type AuthStatus = "loading" | "authenticated" | "unauthenticated";
export declare function PolyfireProvider({ children, project, endpoint, }: {
export declare function PolyfireProvider({ children, project, endpoint, autoLogin, }: {
children: ReactNode;
project: string;
endpoint?: string;
autoLogin?: boolean;
}): JSX.Element;

@@ -9,0 +10,0 @@ export default function usePolyfire(): Omit<Client, "auth"> & {

@@ -83,7 +83,7 @@ "use strict";

function PolyfireProvider(_a) {
var children = _a.children, project = _a.project, _b = _a.endpoint, endpoint = _b === void 0 ? "https://api.polyfire.com" : _b;
var children = _a.children, project = _a.project, _b = _a.endpoint, endpoint = _b === void 0 ? "https://api.polyfire.com" : _b, autoLogin = _a.autoLogin;
var _c = (0, react_1.useState)("loading"), status = _c[0], setStatus = _c[1];
var polyfire = (0, react_1.useState)(function () { return (0, client_1.default)({ project: project, endpoint: endpoint }); })[0];
(0, react_1.useEffect)(function () {
polyfire.auth.init().then(function (isAuthenticated) {
polyfire.auth.init(autoLogin).then(function (isAuthenticated) {
setStatus(isAuthenticated ? "authenticated" : "unauthenticated");

@@ -90,0 +90,0 @@ });

{
"name": "polyfire-js",
"version": "0.2.41",
"version": "0.2.42",
"main": "index.js",

@@ -5,0 +5,0 @@ "types": "index.d.ts",

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