Skip to content

Commit 7b0b673

Browse files
Add support for Federated Connection Access Token (#1911)
Co-authored-by: Tushar Pandey <tushar.pandey@okta.com>
1 parent 0f345a9 commit 7b0b673

File tree

10 files changed

+763
-155
lines changed

10 files changed

+763
-155
lines changed

examples/with-shadcn/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { NextRequest } from "next/server"
33
import { auth0 } from "./lib/auth0"
44

55
export async function middleware(request: NextRequest) {
6-
return await auth0.middleware(request)
6+
return await auth0.middleware(request);
77
}
88

99
export const config = {

examples/with-shadcn/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@auth0/nextjs-auth0": "^4.0.0",
12+
"@auth0/nextjs-auth0": "^4.0.1",
1313
"@radix-ui/react-avatar": "^1.1.1",
1414
"@radix-ui/react-collapsible": "^1.1.1",
1515
"@radix-ui/react-dialog": "^1.1.2",

examples/with-shadcn/pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/errors/index.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,46 @@ export class AccessTokenError extends SdkError {
9898
this.code = code;
9999
}
100100
}
101+
102+
/**
103+
* Enum representing error codes related to federated connection access tokens.
104+
*/
105+
export enum FederatedConnectionAccessTokenErrorCode {
106+
/**
107+
* The session is missing.
108+
*/
109+
MISSING_SESSION = "missing_session",
110+
111+
/**
112+
* The refresh token is missing.
113+
*/
114+
MISSING_REFRESH_TOKEN = "missing_refresh_token",
115+
116+
/**
117+
* Failed to exchange the refresh token.
118+
*/
119+
FAILED_TO_EXCHANGE = "failed_to_exchange_refresh_token"
120+
}
121+
122+
/**
123+
* Error class representing an access token error for federated connections.
124+
* Extends the `SdkError` class.
125+
*/
126+
export class FederatedConnectionsAccessTokenError extends SdkError {
127+
/**
128+
* The error code associated with the access token error.
129+
*/
130+
public code: string;
131+
132+
/**
133+
* Constructs a new `FederatedConnectionsAccessTokenError` instance.
134+
*
135+
* @param code - The error code.
136+
* @param message - The error message.
137+
*/
138+
constructor(code: string, message: string) {
139+
super(message);
140+
this.name = "FederatedConnectionAccessTokenError";
141+
this.code = code;
142+
}
143+
}

0 commit comments

Comments
 (0)