refactor get user id from thing

This commit is contained in:
matty 2024-04-02 14:27:59 -04:00
parent 943c301d9a
commit d8396abd36

View File

@ -68,8 +68,11 @@ async function register({
return;
}
const session_id = await storageManager.getData("ncd-sub-session-id-" + user.id) || null;
const sub_plan = await storageManager.getData("ncd-sub-plan-" + user.id) || null;
const session_id = await storageManager.getData(`ncd-sub-session-id-${user.id}`);
const sub_plan = await storageManager.getData(`ncd-sub-plan-${user.id}`);
//const session_id = await storageManager.getData("ncd-sub-session-id-" + user.id) || null;
//const sub_plan = await storageManager.getData("ncd-sub-plan-" + user.id) || null;
res.json({
status: "success",
@ -151,7 +154,7 @@ async function register({
const INSTANCE_URL = "https://" + req.get('host');
// For demonstration purposes, we're using the Checkout session to retrieve the customer ID.
// Typically this is stored alongside the authenticated user in your database.
// Typically this is stored alongside the authenticated user in your database. (psql) users -> userID ->
const { session_id } = req.body;
const checkoutSession = await stripe.checkout.sessions.retrieve(session_id);