mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-05 00:32:03 +00:00
Add middleware to verify, try redirect on .well-knwon to resolve cors redirect issue
This commit is contained in:
parent
93560e36f0
commit
db9f922175
10
src/pages/api/.well-known/lnurlp/[slug].js
Normal file
10
src/pages/api/.well-known/lnurlp/[slug].js
Normal file
@ -0,0 +1,10 @@
|
||||
import { runMiddleware, corsMiddleware } from "@/utils/corsMiddleware";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
// Run CORS middleware first
|
||||
await runMiddleware(req, res, corsMiddleware);
|
||||
|
||||
// Redirect to your lightning address endpoint
|
||||
const { slug } = req.query;
|
||||
res.redirect(307, `/api/lightning-address/lnurlp/${slug}`);
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
import axios from "axios";
|
||||
import { getLightningAddressByName } from "@/db/models/lightningAddressModels";
|
||||
import appConfig from "@/config/appConfig";
|
||||
import { runMiddleware, corsMiddleware } from "@/utils/corsMiddleware";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
await runMiddleware(req, res, corsMiddleware);
|
||||
try {
|
||||
const { name, slug } = req.query;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user