Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tfa-node-sdk

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tfa-node-sdk - npm Package Compare versions

Comparing version 1.6.2 to 2.6.2

lib/api/index.js

4

index.js

@@ -1,1 +0,3 @@

module.exports = require('./lib/tfa');
import TFA from "./lib/tfa.js";
export default TFA;

@@ -1,36 +0,30 @@

const axios = require('axios');
import API from "./api/index.js";
class TFA {
constructor(access_token) {
this.access_token = access_token;
this.baseUrl = "http://localhost:9000/api/auth";
this.baseUrl = "https://tfasoft-api.herokuapp.com/api/auth";
}
authUser(user_token) {
const data = {
"access_token": this.access_token,
"user_token": user_token,
}
constructor(access_token) {
this.access_token = access_token;
}
return axios.post(`${this.baseUrl}/auth/access`, data)
.then((response) => {
const data = {
status: response.status,
data: response.data,
}
async authUser(user_token) {
const data = {
access_token: this.access_token,
user_token: user_token,
};
return data;
})
.catch((error) => {
const data = {
status: error.response.status,
data: error.response.data,
}
try {
const response = await API.post("access", data);
return data;
});
return {
status: response.status,
data: response.data,
};
} catch (error) {
return {
status: error.response.status,
data: error.response.data,
};
}
}
}
module.exports = TFA;
export default TFA;
{
"name": "tfa-node-sdk",
"version": "1.6.2",
"version": "2.6.2",
"description": "Telegram Factor Authentication node library",
"main": "index.js",
"type": "module",
"scripts": {

@@ -34,2 +35,2 @@ "start": "node index.js"

}
}
}

@@ -1,17 +0,13 @@

const tfa = require('tfa-node-sdk');
import tfa from "tfa-node-sdk";
const auth = new tfa('itEvNsiSpmQFNDiOQtKHCVtDc');
const auth = new tfa("rglscfrrdqdjvalsyvwzelrab");
const result = auth.authUser('uAMGSFEFDQUevEHWulAMHIBtz');
const result = auth.authUser("csxieuilrszyhzudxdjqhhhyl");
result.then((result) => {
const data = result.data;
const statCode = result.status;
if (statCode === 200) {
const user = data.user;
console.log(user);
} else {
console.log(data.message);
}
});
if (result.status === 200) {
console.log({ user: result.data });
} else {
console.log({ message: result.data.message });
}
});
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