@peable/services
Advanced tools
Comparing version 0.0.40 to 0.0.41
import axios from "axios"; | ||
const getUserById = async (id, fields) => { | ||
try { | ||
const response = await axios.get(process.env.PEABLE_SERVICES_URL + `/api/users/${id}`); | ||
const response = await axios.get("https://auth.peable.io" + `/api/users/${id}`); | ||
const user = fields | ||
@@ -6,0 +6,0 @@ ? fields.reduce((obj, key) => ({ ...obj, [key]: response.data[key] }), {}) |
@@ -1,6 +0,3 @@ | ||
import dotenv from "dotenv"; | ||
import { useState, useEffect } from "react"; | ||
import axios from "axios"; | ||
dotenv.config(); | ||
const PEABLE_SERVICES_URL = process.env.PEABLE_SERVICES_URL; | ||
const usePeableSession = () => { | ||
@@ -16,3 +13,3 @@ const [session, setSession] = useState(null); | ||
// Fetch token from Peable Auth | ||
const response = await axios.post(PEABLE_SERVICES_URL + "/api/login", { | ||
const response = await axios.post("https://auth.peable.io" + "/api/login", { | ||
// Your login credentials (e.g., username, password) | ||
@@ -24,3 +21,3 @@ }); | ||
// Session retrieval (as before) | ||
const sessionResponse = await axios.get(PEABLE_SERVICES_URL + "/api/auth/session", { | ||
const sessionResponse = await axios.get("https://auth.peable.io" + "/api/auth/session", { | ||
withCredentials: true, | ||
@@ -27,0 +24,0 @@ }); |
{ | ||
"name": "@peable/services", | ||
"version": "0.0.40", | ||
"version": "0.0.41", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
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
1
5375
94