Skip to content

Commit ee92bbd

Browse files
authored
Merge pull request #997 from supertokens/fix/jwt-url
2 parents 276cb4b + fdf91f9 commit ee92bbd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

docs/authentication/m2m/client-credentials.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ It ensures that the validation occurs for the correct token type:
233233
For NodeJS you can use [`jose`](https://github.com/panva/jose) to verify the token.
234234

235235
```tsx
236-
import jose from "jose";
236+
import * as jose from "jose";
237237

238238
const JWKS = jose.createRemoteJWKSet(new URL('^{appInfo.apiDomain}^{appInfo.apiBasePath}/jwt/jwks.json'))
239239

@@ -544,7 +544,7 @@ Hence, a way to distinguish between these two and prevent errors is necessary.
544544
import supertokens from "supertokens-node";
545545
import Session from "supertokens-node/recipe/session";
546546
import express, { Request, Response, NextFunction } from 'express';
547-
import jose from "jose";
547+
import * as jose from "jose";
548548

549549
async function verifySession(req: Request, res: Response, next: NextFunction) {
550550
let session = undefined;

docs/authentication/unified-login/quickstart-guides/multiple-frontends-with-a-single-backend.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Here is an example of how to implement this in the context of an Express API:
233233
import supertokens from "supertokens-node";
234234
import Session from "supertokens-node/recipe/session";
235235
import express, { Request, Response, NextFunction } from 'express';
236-
import jose from "jose";
236+
import * as jose from "jose";
237237

238238
interface RequestWithUserId extends Request {
239239
userId?: string;
@@ -279,7 +279,7 @@ async function verifySession(req: RequestWithUserId, res: Response, next: NextFu
279279
}
280280

281281
const JWKS = jose.createRemoteJWKSet(
282-
new URL("^{appInfo.apiDomain}^{appInfo.apiBasePath}jwt/jwks.json"),
282+
new URL("^{appInfo.apiDomain}^{appInfo.apiBasePath}/jwt/jwks.json"),
283283
);
284284

285285
// This is a basic example on how to validate an OAuth2 Token
@@ -362,7 +362,7 @@ def validate_token(token: str, required_scope: str) -> bool:
362362
api_base_path = "^{appInfo.apiBasePath}"
363363
client_id = "<CLIENT_ID>"
364364

365-
jwks_url = f"{api_domain}{api_base_path}jwt/jwks.json"
365+
jwks_url = f"{api_domain}{api_base_path}/jwt/jwks.json"
366366
jwks_client = PyJWKClient(jwks_url)
367367

368368
try:

docs/authentication/unified-login/verify-tokens.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If your scenario involves a common backend with multiple frontend clients you ca
5555
For NodeJS you can use [`jose`](https://github.com/panva/jose) to verify the token.
5656

5757
```tsx
58-
import jose from "jose";
58+
import * as jose from "jose";
5959

6060
const JWKS = jose.createRemoteJWKSet(new URL('^{appInfo.apiDomain}^{appInfo.apiBasePath}jwt/jwks.json'))
6161

0 commit comments

Comments
 (0)