Skip to content

Commit

Permalink
probably fix the webapp logging you out every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Sep 22, 2024
1 parent 7e14eda commit 76524bb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/v2/controller/auth.controller.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Request as ExRequest } from "express";
import { Body, Controller, Get, Path, Post, Query, Request, Route, Tags } from "tsoa";
import { BodyProp, Controller, Get, Path, Post, Query, Request, Route, Tags } from "tsoa";
import AuthService from "../service/auth.service";

@Route("auth")
Expand Down Expand Up @@ -68,7 +68,11 @@ export class AuthController extends Controller {
* Handles Discord refresh for new sessions
*/
@Post("discord/refresh")
public async discordAuthRefresh(@Body() refresh_token: string, @Request() request: ExRequest) {
public async discordAuthRefresh(
// use body prop since we only need the one key
@BodyProp() refresh_token: string,
@Request() request: ExRequest,
) {
const params = new URLSearchParams();
params.append("client_id", process.env.DISCORD_CLIENT_ID);
params.append("client_secret", process.env.DISCORD_CLIENT_SECRET);
Expand Down

0 comments on commit 76524bb

Please sign in to comment.