Skip to content

Commit

Permalink
fix: swap jsonwebtoken with jose
Browse files Browse the repository at this point in the history
- support esm/cjs treeshakable without transient dependencies to support various envs
  • Loading branch information
lukashroch committed Jan 18, 2025
1 parent a2f247d commit d69e0bd
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 235 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const state = client.generateState();
Creates authentication URL to redirect user to Duo Security Universal prompt. Provide user identifier and state generated in previous step.

```ts
const authUrl = client.createAuthUrl('username', 'state');
const authUrl = await client.createAuthUrl('username', 'state');
```

### 6. Token & code exchange
Expand Down
2 changes: 1 addition & 1 deletion example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const startApp = async () => {

const state = duoClient.generateState();
req.session.duo = { state, username };
const url = duoClient.createAuthUrl(username, state);
const url = await duoClient.createAuthUrl(username, state);

res.redirect(302, url);
} catch (err) {
Expand Down
144 changes: 12 additions & 132 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@
},
"dependencies": {
"axios": "^1.7.9",
"jsonwebtoken": "^9.0.2"
"jose": "^5.9.6"
},
"devDependencies": {
"@eslint/js": "^9.18.0",
"@types/jest": "^29.5.14",
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "^22.10.6",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
Expand Down
Loading

0 comments on commit d69e0bd

Please sign in to comment.