diff --git a/src/services/loginService.ts b/src/services/loginService.ts index 3ddb7982..36d4d57e 100644 --- a/src/services/loginService.ts +++ b/src/services/loginService.ts @@ -44,7 +44,7 @@ export const createPersonalRooms = async (accountId: Types.ObjectId, shipId: Typ await personalRooms.save(); }; -export const getAccountIdForRequest = async (req: Request): Promise => { +export const getAccountForRequest = async (req: Request) => { if (!req.query.accountId) { throw new Error("Request is missing accountId parameter"); } @@ -61,5 +61,9 @@ export const getAccountIdForRequest = async (req: Request): Promise => { if (!account) { throw new Error("Invalid accountId-nonce pair"); } - return account._id.toString(); + return account; +}; + +export const getAccountIdForRequest = async (req: Request): Promise => { + return (await getAccountForRequest(req))._id.toString(); };