Skip to content

Commit

Permalink
migrate to URLSearchParams
Browse files Browse the repository at this point in the history
  • Loading branch information
wdhdev committed Dec 5, 2024
1 parent 875ba54 commit 062036b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/endpoints/api/auth.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request, Response } from "express";

import querystring from "node:querystring";
import { URLSearchParams } from "url";

export default async (req: Request, res: Response) => {
const params = querystring.stringify({
const params = new URLSearchParams({
client_id: process.env.github_client_id,
redirect_uri: "https://mgp.hrsn.dev/api/callback",
scope: "read:org read:user user:email"
Expand Down
4 changes: 2 additions & 2 deletions src/endpoints/api/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import SessionData from "../../types/SessionData";

import * as Sentry from "@sentry/node";
import axios from "axios";
import querystring from "node:querystring";
import { URLSearchParams } from "url";

export default async (req: Request & SessionData, res: Response) => {
const code = req.query.code as string;

const params = querystring.stringify({
const params = new URLSearchParams({
client_id: process.env.github_client_id,
client_secret: process.env.github_client_secret,
code: code,
Expand Down

0 comments on commit 062036b

Please sign in to comment.