Adding Stripe onboarding (mostly), changing name and branding to Forum

This commit is contained in:
metacryst
2026-02-26 02:12:24 -06:00
parent dd9552aad1
commit 402a99d55c
12 changed files with 47 additions and 20 deletions

View File

@@ -39,10 +39,32 @@ class Server {
router.get('/db/images/*', this.getUserImage)
router.get('/api/orgdata/*', this.getOrgData)
router.get('/api/mydata/*', this.getPersonalData)
router.get('/api/stripe/onboarded', this.stripeOnboarded)
router.get('/*', this.get)
return router
}
async stripeOnboarded() {
const { code } = req.body;
const response = await stripe.oauth.token({
grant_type: "authorization_code",
code,
});
const { stripe_user_id, access_token } = response;
await db.users.update({
where: { id: req.user.id },
data: {
stripeAccountId: stripe_user_id,
stripeAccessToken: access_token,
}
});
res.json({ success: true });
}
getPersonalData = async (req, res, next) => {
try {
const memberId = req.params[0]
@@ -226,8 +248,8 @@ class Server {
const app = express();
app.post("/webhook", express.raw({ type: "application/json" }), PaymentsHandler.webhook)
const allowedOrigins = new Set([
"https://www.parchment.page",
"https://parchment.page",
"https://www.frm.so",
"https://frm.so",
"http://localhost:5174",
"http://sam.local:5174",
"http://localhost:5173",
@@ -266,7 +288,7 @@ class Server {
const PORT = 10002;
server.listen(PORT, () => {
console.log("\n")
console.log(chalk.yellow("*************** parchment.page ********"))
console.log(chalk.yellow("*************** frm.so ********"))
console.log(chalk.yellowBright(`Server is running on port ${PORT}: http://localhost`));
console.log(chalk.yellow("***************************************"))
console.log("\n")