Skip to content

Commit

Permalink
feat: automatically enable the client_credentials and refresh_token g…
Browse files Browse the repository at this point in the history
…rants
  • Loading branch information
jasonraimondi committed Aug 9, 2024
1 parent a25682f commit 8d29c06
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
1 change: 1 addition & 0 deletions src/authorization_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export class AuthorizationServer {
refresh_token: new RefreshTokenGrant(...grantProps),
implicit: new ImplicitGrant(...grantProps),
};
this.enableGrantTypes("client_credentials", "refresh_token");
}

enableGrantTypes(...grants: EnableGrant[]): void {
Expand Down
3 changes: 0 additions & 3 deletions test/e2e/authorization_server.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,11 @@ describe("authorization_server", () => {
authCodeRepository: inMemoryAuthCodeRepository,
userRepository: inMemoryUserRepository,
});
authorizationServer.enableGrantType("client_credentials");
authorizationServer.enableGrantType("implicit");
authorizationServer.enableGrantType({
grant: "password",
userRepository: inMemoryUserRepository,
});
authorizationServer.enableGrantType("refresh_token");
const customGrant = new MyCustomGrant(
inMemoryClientRepository,
inMemoryAccessTokenRepository,
Expand Down Expand Up @@ -202,7 +200,6 @@ describe("authorization_server", () => {
inMemoryScopeRepository,
new JwtService("secret-key"),
);
authorizationServer.enableGrantType("refresh_token");
const request = new OAuthRequest({
query: {
response_type: "code",
Expand Down

0 comments on commit 8d29c06

Please sign in to comment.