Skip to content

Commit 062036b

Browse files
committed
migrate to URLSearchParams
1 parent 875ba54 commit 062036b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/endpoints/api/auth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Request, Response } from "express";
22

3-
import querystring from "node:querystring";
3+
import { URLSearchParams } from "url";
44

55
export default async (req: Request, res: Response) => {
6-
const params = querystring.stringify({
6+
const params = new URLSearchParams({
77
client_id: process.env.github_client_id,
88
redirect_uri: "https://mgp.hrsn.dev/api/callback",
99
scope: "read:org read:user user:email"

src/endpoints/api/callback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import SessionData from "../../types/SessionData";
33

44
import * as Sentry from "@sentry/node";
55
import axios from "axios";
6-
import querystring from "node:querystring";
6+
import { URLSearchParams } from "url";
77

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

11-
const params = querystring.stringify({
11+
const params = new URLSearchParams({
1212
client_id: process.env.github_client_id,
1313
client_secret: process.env.github_client_secret,
1414
code: code,

0 commit comments

Comments
 (0)