Skip to content

Commit

Permalink
optimize the annotation
Browse files Browse the repository at this point in the history
Signed-off-by: yubonluo <[email protected]>
  • Loading branch information
yubonluo committed Jun 21, 2024
1 parent 6de5625 commit c78e1af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions server/auth/types/authentication_type.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe('test capabilities request authinfo', () => {
asScoped: jest.fn().mockImplementation(() => {
return {
callAsCurrentUser: jest.fn().mockImplementation(() => {
return { username: 'capabolities-username' };
return { username: 'capabilities-username' };
}),
};
}),
Expand Down Expand Up @@ -162,6 +162,6 @@ describe('test capabilities request authinfo', () => {
authenticated: jest.fn((value) => value),
};
const result = await dummyAuthType.authHandler(request, response, toolkit);
expect(result.state.authInfo.username).toEqual('capabolities-username');
expect(result.state.authInfo.username).toEqual('capabilities-username');
});
});
3 changes: 1 addition & 2 deletions server/auth/types/authentication_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export abstract class AuthenticationType implements IAuthenticationType {
return toolkit.notHandled();
}

// Before users login, skip auth capabilities request.
// allow optional authentication
if (this.authOptional(request)) {
return toolkit.authenticated();
}
Expand Down Expand Up @@ -244,7 +244,6 @@ export abstract class AuthenticationType implements IAuthenticationType {
if (!pathname) {
return false;
}
// allow requests to ignored routes
if (AuthenticationType.ROUTES_AUTH_OPTIONAL.includes(pathname!)) {
return true;
}
Expand Down

0 comments on commit c78e1af

Please sign in to comment.