@peable/services
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -7,2 +7,3 @@ interface User { | ||
avatar: string; | ||
profile_image_url: string; | ||
} | ||
@@ -9,0 +10,0 @@ declare const getUserById: (id?: string[], fields?: (keyof User)[]) => Promise<any>; |
import axios from "axios"; | ||
const getUserById = async (id, fields) => { | ||
try { | ||
const response = await axios.get(`http://localhost:3001/api/users/${id}`); | ||
const response = await axios.get(process.env.PEABLE_SERVICES_URL + `/api/users/${id}`); | ||
const user = fields | ||
@@ -6,0 +6,0 @@ ? fields.reduce((obj, key) => ({ ...obj, [key]: response.data[key] }), {}) |
@@ -8,2 +8,3 @@ interface SessionData { | ||
avatar: string; | ||
profile_image_url: string; | ||
}; | ||
@@ -10,0 +11,0 @@ } |
@@ -13,3 +13,3 @@ import { useState, useEffect } from "react"; | ||
// Fetch token from Peable Auth | ||
const response = await axios.post("http://localhost:3001/api/login", { | ||
const response = await axios.post(process.env.PEABLE_SERVICES_URL + "/api/login", { | ||
// Your login credentials (e.g., username, password) | ||
@@ -21,3 +21,3 @@ }); | ||
// Session retrieval (as before) | ||
const sessionResponse = await axios.get("http://localhost:3001/api/auth/session", { | ||
const sessionResponse = await axios.get(process.env.PEABLE_SERVICES_URL + "/api/auth/session", { | ||
withCredentials: true, | ||
@@ -24,0 +24,0 @@ }); |
{ | ||
"name": "@peable/services", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5129
92
4