Skip to content

Commit

Permalink
fix(login): Use old login response body (#4)
Browse files Browse the repository at this point in the history
Use the older login response so existing clients can continue functioning
  • Loading branch information
wingio authored Oct 27, 2024
1 parent 4c3311c commit 19146fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/common/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export async function generateToken(userID: bigint, addToDatabase: boolean): Pro
userID,
seed,
token,
// FIXME: why is this a string if the whole thing is provided? -- splatter
full: `${userID}.${seed}.${token}`
};
}
Expand Down
5 changes: 4 additions & 1 deletion src/rest/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export default class AuthController {
const body = req.body as LoginBody;
const auth = await checkCredentials(body.email, body.password);

return { token: await generateToken(auth, true) };
return {
id: auth,
token: (await generateToken(auth, true)).full
};
}

@POST({
Expand Down

0 comments on commit 19146fd

Please sign in to comment.