Skip to content

Commit

Permalink
no alg
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Jan 16, 2024
1 parent 7ded33a commit b5f8a6c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions handlers/customLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ function customLogin(usernameField, usertypeField) {
let token = {};
// get user id from env
username = process.env[usernameField] || "unknown user";
token.sub = username;
token.email = username;
token.name = username;
token['sub'] = username;
token['email'] = username;
token['name ']= username;
usertype = process.env[usertypeField];
token.userType = usertype || "Participant";
token['userType'] = usertype || "Participant";
// generate token with this info
// return the token
signedToken = jwt.sign(token, "precision-fda-not-secure-token", {
algorithm: 'RS256',
expiresIn: EXPIRY,
});
res.json({"token": signedToken});
Expand Down

0 comments on commit b5f8a6c

Please sign in to comment.