Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ class NeetoJWT {
exp,
};

const token = jwt.sign(payload, this.privateKey, { algorithm: "ES256" });
return token;
try {
const token = jwt.sign(payload, this.privateKey, { algorithm: "ES256" });
return token;
} catch (error) {
throw new Error(
`Your key is invalid. We use asymmetric encryption for SSO login.\nPlease fill out https://neeto-jwt.neetodesk.com/forms/jwt-login-in-neeto.\nWe will generate a public-private key pair and share the private key with you. This key will assist you with SSO login.`
Comment thread
AbhayVAshokan marked this conversation as resolved.
);
}

return null;
Comment thread
AbhayVAshokan marked this conversation as resolved.
};

generateLoginUrl = (redirectUri: string) => {
Expand Down
Loading