diff --git a/.changeset/brown-grapes-fold.md b/.changeset/brown-grapes-fold.md index 6f9c7bcab5..d8ab0a23f3 100644 --- a/.changeset/brown-grapes-fold.md +++ b/.changeset/brown-grapes-fold.md @@ -1,5 +1,5 @@ --- -'@backstage/plugin-auth-backend-module-auth0-provider': minor +'@backstage/plugin-auth-backend-module-auth0-provider': patch --- -feat: Add support for organizational invites in auth0 strategy +Add support for organizational invites in auth0 strategy diff --git a/plugins/auth-backend-module-auth0-provider/src/module.test.ts b/plugins/auth-backend-module-auth0-provider/src/module.test.ts index 773cb70a85..28ccf90fa4 100644 --- a/plugins/auth-backend-module-auth0-provider/src/module.test.ts +++ b/plugins/auth-backend-module-auth0-provider/src/module.test.ts @@ -175,7 +175,7 @@ describe('authModuleAuth0Provider', () => { '/api/auth/auth0/start?env=development&organization=foo-organization&invitation=foo-invitation', ); - expect(res.status).toEqual(409); + expect(res.status).toEqual(400); expect(res.text).toContain( 'Organization mismatch. The organization provided in the request does not match the organization configured in the strategy.', ); diff --git a/plugins/auth-backend-module-auth0-provider/src/strategy.ts b/plugins/auth-backend-module-auth0-provider/src/strategy.ts index a89c9199cf..b6252aa7bd 100644 --- a/plugins/auth-backend-module-auth0-provider/src/strategy.ts +++ b/plugins/auth-backend-module-auth0-provider/src/strategy.ts @@ -17,7 +17,7 @@ import Auth0InternalStrategy from 'passport-auth0'; import type { StateStore } from 'passport-oauth2'; import type express from 'express'; -import { ConflictError } from '@backstage/errors'; +import { InputError } from '@backstage/errors'; /** @public */ export interface Auth0StrategyOptionsWithRequest { @@ -58,7 +58,7 @@ export class Auth0Strategy extends Auth0InternalStrategy { this.organization && organization !== this.organization ) { - throw new ConflictError( + throw new InputError( 'Organization mismatch. The organization provided in the request does not match the organization configured in the strategy.', ); }