Skip to content

Commit

Permalink
Merge pull request #372 from Open-Earth-Foundation/fix/invite-system-…
Browse files Browse the repository at this point in the history
…verification

fix(api): use environment host as redirect url
  • Loading branch information
lemilonkh authored Mar 12, 2024
2 parents b639346 + 389e22f commit c8709ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/app/api/v0/city/invite/[invite]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export const GET = apiHandler(async (req, { params, session }) => {
email: email!,
},
});

const host = process.env.HOST ?? "http://localhost:3000";
if (!user) {
return NextResponse.redirect("/");
return NextResponse.redirect(host);
}

const city = await db.models.City.findOne({
Expand All @@ -45,5 +45,5 @@ export const GET = apiHandler(async (req, { params, session }) => {

await user?.addCity(city?.cityId);

return NextResponse.redirect("/");
return NextResponse.redirect(host);
});

0 comments on commit c8709ca

Please sign in to comment.