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

calimero-auth-sdk

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calimero-auth-sdk - npm Package Compare versions

Comparing version 0.5.8 to 0.5.9

6

lib/index.d.ts

@@ -27,1 +27,7 @@ import * as nearAPI from "near-api-js";

}
export declare class CalimeroAuth {
constructor();
isSignedIn(): boolean;
signIn(config: any): void;
signOut(): void;
}

16

lib/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CalimeroToken = exports.CalimeroTokenData = exports.WalletData = exports.MAX_CALIMERO_TOKEN_DURATION = void 0;
exports.CalimeroAuth = exports.CalimeroToken = exports.CalimeroTokenData = exports.WalletData = exports.MAX_CALIMERO_TOKEN_DURATION = void 0;
const js_sha256_1 = require("js-sha256");

@@ -73,11 +73,14 @@ const axios = require("axios");

class CalimeroAuth {
static isSignedIn() {
constructor() { }
isSignedIn() {
return localStorage.getItem("calimeroToken") !== null;
}
static signIn(config) {
signIn(config) {
if (!localStorage.getItem("calimeroSecret")) {
console.log("No calimeroSecret, generating and redirecting to the wallet");
localStorage.setItem("calimeroSecret", randomstring.generate({ length: 128 }));
localStorage.setItem("calimeroSecretHash", js_sha256_1.sha256.update(localStorage.getItem("calimeroSecret")).toString());
console.log("Redirect to the wallet");
const callbackUrl = encodeURIComponent(window.location.href);
window.location.href = `${config.walletUrl}?message=${localStorage.getItem("calimeroSecretHash")}&callbackUrl=${callbackUrl}`;
window.location.assign(`${config.walletUrl}?message=${localStorage.getItem("calimeroSecretHash")}&callbackUrl=${callbackUrl}`);
}

@@ -107,3 +110,3 @@ const search = window.location.search;

}
static signOut() {
signOut() {
localStorage.removeItem("calimeroToken");

@@ -114,2 +117,3 @@ localStorage.removeItem("calimeroSecret");

}
exports.CalimeroAuth = CalimeroAuth;
module.exports = {

@@ -120,3 +124,3 @@ MAX_CALIMERO_TOKEN_DURATION: exports.MAX_CALIMERO_TOKEN_DURATION,

CalimeroTokenData,
CalimeroAuth,
CalimeroAuth
};
{
"name": "calimero-auth-sdk",
"version": "0.5.8",
"version": "0.5.9",
"main": "lib/index.js",

@@ -5,0 +5,0 @@ "type": "commonjs",

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