Skip to content

Commit 68b3239

Browse files
committed
chore: change config name
1 parent 1257da9 commit 68b3239

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/server/auth-client.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,7 @@ ca/T0LLtgmbMmxSv/MmzIg==
22462246
expect(response.body).toBeNull();
22472247
});
22482248

2249-
it("should return a 204 if the user is not authenticated and emptyProfileResponseWhenUnauthenticated is enabled", async () => {
2249+
it("should return a 204 if the user is not authenticated and noContentProfileResponseWhenUnauthenticated is enabled", async () => {
22502250
const secret = await generateSecret(32);
22512251
const transactionStore = new TransactionStore({
22522252
secret
@@ -2267,7 +2267,7 @@ ca/T0LLtgmbMmxSv/MmzIg==
22672267

22682268
fetch: getMockAuthorizationServer(),
22692269

2270-
emptyProfileResponseWhenUnauthenticated: true
2270+
noContentProfileResponseWhenUnauthenticated: true
22712271
});
22722272

22732273
const request = new NextRequest(

src/server/auth-client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export interface AuthClientOptions {
135135
httpTimeout?: number;
136136
enableTelemetry?: boolean;
137137
enableAccessTokenEndpoint?: boolean;
138-
emptyProfileResponseWhenUnauthenticated?: boolean;
138+
noContentProfileResponseWhenUnauthenticated?: boolean;
139139
}
140140

141141
function createRouteUrl(url: string, base: string) {
@@ -170,7 +170,7 @@ export class AuthClient {
170170
private authorizationServerMetadata?: oauth.AuthorizationServer;
171171

172172
private readonly enableAccessTokenEndpoint: boolean;
173-
private readonly emptyProfileResponseWhenUnauthenticated: boolean;
173+
private readonly noContentProfileResponseWhenUnauthenticated: boolean;
174174

175175
constructor(options: AuthClientOptions) {
176176
// dependencies
@@ -260,8 +260,8 @@ export class AuthClient {
260260
};
261261

262262
this.enableAccessTokenEndpoint = options.enableAccessTokenEndpoint ?? true;
263-
this.emptyProfileResponseWhenUnauthenticated =
264-
options.emptyProfileResponseWhenUnauthenticated ?? false;
263+
this.noContentProfileResponseWhenUnauthenticated =
264+
options.noContentProfileResponseWhenUnauthenticated ?? false;
265265
}
266266

267267
async handler(req: NextRequest): Promise<NextResponse> {
@@ -584,7 +584,7 @@ export class AuthClient {
584584
const session = await this.sessionStore.get(req.cookies);
585585

586586
if (!session) {
587-
if (this.emptyProfileResponseWhenUnauthenticated) {
587+
if (this.noContentProfileResponseWhenUnauthenticated) {
588588
return new NextResponse(null, {
589589
status: 204
590590
});

src/server/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export interface Auth0ClientOptions {
175175
*
176176
* Defaults to `false`.
177177
*/
178-
emptyProfileResponseWhenUnauthenticated?: boolean;
178+
noContentProfileResponseWhenUnauthenticated?: boolean;
179179
}
180180

181181
export type PagesRouterRequest = IncomingMessage | NextApiRequest;
@@ -279,8 +279,8 @@ export class Auth0Client {
279279
httpTimeout: options.httpTimeout,
280280
enableTelemetry: options.enableTelemetry,
281281
enableAccessTokenEndpoint: options.enableAccessTokenEndpoint,
282-
emptyProfileResponseWhenUnauthenticated:
283-
options.emptyProfileResponseWhenUnauthenticated
282+
noContentProfileResponseWhenUnauthenticated:
283+
options.noContentProfileResponseWhenUnauthenticated
284284
});
285285
}
286286

0 commit comments

Comments
 (0)