From 2dae0bd0c2c20754218d7ea2cef11ba2099994c2 Mon Sep 17 00:00:00 2001
From: Matt Kirby <MattJKirby@outlook.com>
Date: Sun, 16 Apr 2023 23:41:37 +0100
Subject: [PATCH] Fixed token stuff

---
 backend-services/friend-service/src/Middleware/Auth.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/backend-services/friend-service/src/Middleware/Auth.ts b/backend-services/friend-service/src/Middleware/Auth.ts
index 5703ac90..6e13a5ee 100644
--- a/backend-services/friend-service/src/Middleware/Auth.ts
+++ b/backend-services/friend-service/src/Middleware/Auth.ts
@@ -5,7 +5,12 @@ import Config from '../../config'
 export const SECRET_KEY: Secret = Config.JWT_SECRET;
 
 export interface CustomJWTRequest extends Request {
- token?: string | JwtPayload;
+ token?: string | JwtPayload | TokenData;
+}
+
+export type TokenData = {
+  userId: string,
+  username: string
 }
 
 export const authorize = async (req: Request, res: Response, next: NextFunction) => {
-- 
GitLab