diff --git a/README.md b/README.md index e66b4fc..d96c5db 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ import { serve } from "https://deno.land/std/http/server.ts" import { encode, decode } from "https://deno.land/std/strings/mod.ts" import makeJwt, { setExpiration, -} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/create.ts" -import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/validate.ts" +} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/create.ts" +import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/validate.ts" const key = "abc" const claims = { diff --git a/examples/example.js b/examples/example.js deleted file mode 100644 index d3e6c2d..0000000 --- a/examples/example.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -exports.__esModule = true; -var create_ts_1 = require("../create.ts"); -var create_ts_2 = require("../create.ts"); -var validate_ts_1 = require("../validate.ts"); -var claims = { - iss: "joe", - exp: create_ts_2.setExpiration(new Date().getTime() + 1000), - jti: ["jj"] -}; -var headerObject = { - alg: "HS256", - typ: "JWT", - crit: ["dummy"] -}; -var handlers = { - exp: function (header) { - return (header.exp = "2019-12-09"); - }, - dummy: function (header) { - console.log("dummy works"); - return 100; - } -}; -var key = "abcdef"; -try { - var jwt = create_ts_1["default"](headerObject, claims, key); - var validatedJwt = validate_ts_1["default"](jwt, key, true, handlers); - console.log(jwt); - console.log(validatedJwt); - validatedJwt.then(console.log); -} -catch (err) { - console.log(err); -} diff --git a/examples/example.ts b/examples/example.ts index 716a881..2a1047e 100644 --- a/examples/example.ts +++ b/examples/example.ts @@ -1,7 +1,7 @@ import makeJwt, { setExpiration, -} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/create.ts" -import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/validate.ts" +} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/create.ts" +import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/validate.ts" const claims = { iss: "joe", diff --git a/examples/mini_example.ts b/examples/mini_example.ts index e79830d..53e0ad8 100644 --- a/examples/mini_example.ts +++ b/examples/mini_example.ts @@ -1,7 +1,7 @@ import { serve } from "https://deno.land/std/http/server.ts" import { encode, decode } from "https://deno.land/std/strings/mod.ts" -import makeJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/create.ts" -import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/validate.ts" +import makeJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/create.ts" +import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/validate.ts" ;(async () => { for await (const req of serve("0.0.0.0:8000")) { if (req.method === "GET") diff --git a/examples/readme_example.ts b/examples/readme_example.ts index cd26738..c6a8c4a 100644 --- a/examples/readme_example.ts +++ b/examples/readme_example.ts @@ -2,8 +2,8 @@ import { serve } from "https://deno.land/std/http/server.ts" import { encode, decode } from "https://deno.land/std/strings/mod.ts" import makeJwt, { setExpiration, -} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/create.ts" -import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/validate.ts" +} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/create.ts" +import validateJwt from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/validate.ts" const key = "abc" const claims = { diff --git a/validate.ts b/validate.ts index 08c749a..77027bd 100644 --- a/validate.ts +++ b/validate.ts @@ -3,7 +3,7 @@ import { addPaddingToBase64url } from "https://denopkg.com/timonson/base64url/ba import makeJwt, { Claims, Jose, -} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.0/create.ts" +} from "https://cdn.jsdelivr.net/gh/timonson/djwt@0.2.1/create.ts" interface CritHandlers { [key: string]: (header?: any) => any