Skip to content

Commit d70b909

Browse files
authored
update alg type (#394)
1 parent 2cc3530 commit d70b909

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

advanced/user-auth/jwt.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ If you don’t have a dashboard, or if you want to keep your dashboard and docs
1515
Create a login flow that does the following:
1616
- Authenticate the user
1717
- Create a JWT containing the authenticated user's info in the [UserInfo](./sending-data) format
18-
- Sign the JWT with the secret, using the ES256 algorithm
18+
- Sign the JWT with the secret, using the EdDSA algorithm
1919
- Create a redirect URL back to your docs, including the JWT as the hash
2020
</Step>
2121
<Step title="Configure your User Auth settings">
@@ -46,7 +46,7 @@ import { Request, Response } from 'express';
4646

4747
const TWO_WEEKS_IN_MS = 1000 * 60 * 60 * 24 * 7 * 2;
4848

49-
const signingKey = await jose.importPKCS8(process.env.MINTLIFY_PRIVATE_KEY, 'ES256');
49+
const signingKey = await jose.importPKCS8(process.env.MINTLIFY_PRIVATE_KEY, 'EdDSA');
5050

5151
export async function handleRequest(req: Request, res: Response) {
5252
const userInfo = {
@@ -59,7 +59,7 @@ export async function handleRequest(req: Request, res: Response) {
5959
};
6060

6161
const jwt = await new jose.SignJWT(userInfo)
62-
.setProtectedHeader({ alg: 'ES256' })
62+
.setProtectedHeader({ alg: 'EdDSA' })
6363
.setExpirationTime('10 s')
6464
.sign(signingKey);
6565

0 commit comments

Comments
 (0)