From a424a8a4d2b6739b79118ae4980948f56be64a80 Mon Sep 17 00:00:00 2001 From: murdle Date: Sat, 20 Dec 2025 19:37:06 +0200 Subject: [PATCH] add user id in loginresponse --- assets/openapi.json | Bin 844394 -> 844491 bytes assets/schemas.json | Bin 3410350 -> 3410520 bytes src/api/routes/auth/login.ts | 2 +- src/schemas/responses/TokenResponse.ts | 1 + 4 files changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/openapi.json b/assets/openapi.json index d2f82e3f48a21c54386ce2f5d7289d4feaa5d58a..5d22ad7898e0c221cccce7249d79993498d65151 100644 GIT binary patch delta 75 zcmaEL#Q5}4FEiAnr(-%~-NKe;4&FD7$!V4yk=@W!mINI-eumCYD5VHX> VI}n4!IDwc8h`G1l_2B892>`4sA9Mf! delta 65 zcmX?o)cDmAFEiAnr(=WVW@|ZqBn1!R=&XWa*S%H`hh}nS{B*qEETtLjd K-OiJzcP0QRw-!GD diff --git a/assets/schemas.json b/assets/schemas.json index d2b7c2803324145969cf250b18e83e31575798bd..f755669c28932e02d86e24c0a1a9845db45b6aa9 100644 GIT binary patch delta 234 zcmWN=Cl11300z*s?7c^sW$)2)0SspV%LNDufvWhDCI}1-zeOPl2_#$ti9{kvkO=r* z@=m+E^sw%d0SPi}u)_f-TyVn!FMRMLfFME$BZ4Smh+h+FYroN=VtJ4iVf6fY@&4MU z=E6#Fl2e>!g)^Mx9Ot>fMOL}QWv+0QYh33BH@U@a?r@iT+~)xgZwpKNOvL-;nTxT{ fu@Yw#RWY75oMJ2MgUj=?uA0Z6#`^8}8@auI_C#J@ delta 241 zcmWN=yH3Jj7zW_99BM_VpnnSj0#flv5t-Q7UD!yt1qPXz9o~eMM3V0ooXl@x(v%Rx zBr78cBRAj`sPB_J+xf1jIdjJ3c diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts index 06e3fe43..d751d7e6 100644 --- a/src/api/routes/auth/login.ts +++ b/src/api/routes/auth/login.ts @@ -201,7 +201,7 @@ router.post( // Discord header is just the user id as string, which is not possible with npm-jsonwebtoken package // https://user-images.githubusercontent.com/6506416/81051916-dd8c9900-8ec2-11ea-8794-daf12d6f31f0.png - res.json({ token, settings: { ...user.settings, index: undefined } }); + res.json({ user_id: user.id, token, settings: { ...user.settings, index: undefined } }); }, ); diff --git a/src/schemas/responses/TokenResponse.ts b/src/schemas/responses/TokenResponse.ts index c0f1346c..4deacc01 100644 --- a/src/schemas/responses/TokenResponse.ts +++ b/src/schemas/responses/TokenResponse.ts @@ -21,6 +21,7 @@ import { BackupCode, UserSettings } from "../../util/entities"; export interface TokenResponse { token: string; settings: UserSettings; + user_id?: string; } export interface TokenOnlyResponse {