Skip to content

Commit f8d233e

Browse files
authored
fix: use npm library in jwt example (#1346)
1 parent c109487 commit f8d233e

File tree

2 files changed

+7
-86
lines changed

2 files changed

+7
-86
lines changed

deno.lock

Lines changed: 4 additions & 80 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/scripts/creating_and_verifying_jwt.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
* @difficulty intermediate
44
* @tags cli, deploy
55
* @run <url>
6-
* @resource {https://deno.land/x/jose} Doc: jose library for Deno
6+
* @resource {https://docs.deno.com/runtime/manual/node/npm_specifiers} npm: specifiers
7+
* @resource {https://www.npmjs.com/package/jose} jose library on npm
78
* @group Authentication
89
*
910
* This example demonstrates how to create and verify a JSON Web Token (JWT)
@@ -14,11 +15,7 @@
1415
*/
1516

1617
// Import necessary functions and types from the `jose` library.
17-
import {
18-
JWTPayload,
19-
jwtVerify,
20-
SignJWT,
21-
} from "https://deno.land/x/jose@v5.9.4/index.ts";
18+
import { JWTPayload, jwtVerify, SignJWT } from "npm:jose@5.9.6";
2219

2320
// Define a secret key used for signing and verifying JWTs. Ensure that this secret is kept secure in a real-world application.
2421
const secret = new TextEncoder().encode("secret-that-no-one-knows");

0 commit comments

Comments
 (0)