Skip to content

Commit

Permalink
fix: temp callback fix
Browse files Browse the repository at this point in the history
  • Loading branch information
veryCrunchy committed Mar 1, 2024
1 parent e3537ea commit 7cabe92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ app.get("/token/validate", async (req, res) => {
res.status(401).send((e as Error).message);
}
});
const port = process.env.PORT || 4000
const port = process.env.PORT || 4000;
app.listen(port, () => {
console.log(`Running at ${process.env.BASE_URL}`);
});

async function handleAuthCallback(req: Request, res: Response) {
const redirectPath = req.cookies.redirect_path ?? "/";
const callbackURL =
req.cookies.token_callback?.toString() ?? process.env.CALLBACK_URL;
// const callbackURL =
// req.cookies.token_callback?.toString() ?? process.env.CALLBACK_URL;
const callbackURL = process.env.CALLBACK_URL ?? "";
const error = req.query.error?.toString() ?? null;
let url = new URL(callbackURL);
url.searchParams.set("redirect", redirectPath);
Expand Down

0 comments on commit 7cabe92

Please sign in to comment.