Skip to content

Commit

Permalink
more typo :)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Apr 28, 2024
1 parent 73c7b29 commit aed3d3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const data = await validateJWT(jwt, cryptoKey);
const data = await validateJWT(jwt, false);
```

- **`unsafeParseJWT(jwt: string): Promise<JWTPayload>`**
- **`unsafeParseJWT(jwt: string): JWTPayload`**

```javascript
// "unsafely" parse a JWT without cryptokey, will return the payload.
Expand Down
4 changes: 2 additions & 2 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,10 @@ export async function verify(key: CryptoKey, data: string, signature: string, op
* "unsafely" parse a JWT without cryptokey.
*
* @param {string} jwt - The encoded JWT string.
* @returns {Promise<JWTPayload>} A promise resolving to the decoded JWT payload.
* @returns {JWTPayload} A promise resolving to the decoded JWT payload.
* @throws {JWTParseError} If the jwt string is not parsable.
*/
export function unsafeParseJWT(jwt: string): Promise<JWTPayload> {
export function unsafeParseJWT(jwt: string): JWTPayload {
try {
const jwtParts = validateParts(jwt);
const payload = JSON.parse(textDecode(decodeBase64Url(jwtParts[1])));
Expand Down

0 comments on commit aed3d3b

Please sign in to comment.