Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 082c82f

Browse files
committed
0.2.1
1 parent 23309ae commit 082c82f

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ npm install @rbxts/jwt
1212
```
1313
### via Wally
1414
```
15-
jwt = "metrik-tech/jwt@0.2.0"
15+
jwt = "metrik-tech/jwt@0.2.1"
1616
```
1717
### via `rbxm`/`rbxmx`
1818
Download from Releases page. Latest release can be found [here](

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rbxts/jwt",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "JWT lib for Luau",
55
"main": "out/init.lua",
66
"scripts": {

src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function base64urlEncode(str: string) {
2525
return encode(str).gsub("+", "-")[0].gsub("/", "_")[0].gsub("=", "")[0];
2626
}
2727

28-
function encodeJWT(data: unknown, key: string, alg: string | undefined = "HS256"): string {
28+
function encodeJWT(data: unknown, key: string, alg = "HS256"): string {
2929
if (typeOf(data) !== "table" || !table) {
3030
error("data must be a table");
3131
}
@@ -56,8 +56,8 @@ function encodeJWT(data: unknown, key: string, alg: string | undefined = "HS256"
5656

5757
function decodeJWT(
5858
data: string,
59-
key: string | undefined,
60-
verify: boolean | undefined,
59+
key?: string,
60+
verify?: boolean,
6161
): {
6262
header: { alg: string; typ: string };
6363
body: { exp: number; iat: number; nbf: number; [key: string]: unknown };
@@ -108,7 +108,7 @@ function decodeJWT(
108108
return payload;
109109
}
110110

111-
function verifyJWT(data: string, key: string, throwErrors: boolean | undefined = false): boolean {
111+
function verifyJWT(data: string, key: string, throwErrors = false): boolean {
112112
if (typeOf(data) !== "string" || !data) {
113113
error("data must be a string");
114114
}

wally.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ registry = "test"
44

55
[[package]]
66
name = "metrik-tech/jwt"
7-
version = "0.2.0"
7+
version = "0.2.1"
88
dependencies = []

wally.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "metrik-tech/jwt"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
license = "AGPL-3.0-or-later"
55
authors = ["cursecodes"]
66
registry = "https://github.com/UpliftGames/wally-index"

0 commit comments

Comments
 (0)