Skip to content

Commit 983b86e

Browse files
author
DylanBulmer
committed
update JWT gen func
1 parent b26b422 commit 983b86e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codrjs/core",
3-
"version": "1.0.6-patch6",
3+
"version": "1.0.6-patch7",
44
"description": "An open-sourced customizable annotation tool",
55
"main": "./cjs/index.js",
66
"module": "./esm/index.js",

src/classes/JWT.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ export function generateToken(payload: IUser) {
6161
const signOpts: jwt.SignOptions = {
6262
issuer: process.env.JWT_ISSUER,
6363
algorithm: <Algorithm>process.env.JWT_ALGORITHM,
64-
subject: payload._id,
64+
// subject: payload._id,
6565
};
6666
return jwt.sign(payload, <string>process.env.JWT_SECRET, signOpts);
6767
} catch (err: any) {
6868
throw new Error({
6969
status: 500,
7070
message: err?.message || "Couldn't generate the JWT token",
71+
details: err,
7172
});
7273
}
7374
}

src/services/auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ class Authentication {
125125
status: 500,
126126
message:
127127
"An unexpected error occured while generating a JSON web token.",
128+
details: e?.details,
128129
});
129130
}
130131
} else {

0 commit comments

Comments
 (0)