@peable/services
Advanced tools
Comparing version 0.0.44 to 0.0.45
@@ -12,5 +12,3 @@ interface SessionData { | ||
} | ||
declare const usePeableSession: (config: { | ||
SERVICES_URL: string; | ||
}) => { | ||
declare const usePeableSession: () => { | ||
session: SessionData | null; | ||
@@ -17,0 +15,0 @@ status: "loading" | "loaded"; |
import { useState, useEffect } from "react"; | ||
import axios from "axios"; | ||
const usePeableSession = (config) => { | ||
const usePeableSession = () => { | ||
const PEABLE_SERVICES_URL = process.env.PEABLE_SERVICES_URL; | ||
const [session, setSession] = useState(null); | ||
@@ -13,3 +14,3 @@ const [status, setStatus] = useState("loading"); | ||
// Fetch token from Peable Auth | ||
const response = await axios.post(config.SERVICES_URL + "/api/login", { | ||
const response = await axios.post(PEABLE_SERVICES_URL + "/api/login", { | ||
// Your login credentials (e.g., username, password) | ||
@@ -21,3 +22,3 @@ }); | ||
// Session retrieval (as before) | ||
const sessionResponse = await axios.get(config.SERVICES_URL + "/api/auth/session", { | ||
const sessionResponse = await axios.get(PEABLE_SERVICES_URL + "/api/auth/session", { | ||
withCredentials: true, | ||
@@ -24,0 +25,0 @@ }); |
{ | ||
"name": "@peable/services", | ||
"version": "0.0.44", | ||
"version": "0.0.45", | ||
"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
5247
93
2