diff --git a/.changeset/calm-jars-wear.md b/.changeset/brown-grapes-fold.md similarity index 51% rename from .changeset/calm-jars-wear.md rename to .changeset/brown-grapes-fold.md index 2b71931600..6f9c7bcab5 100644 --- a/.changeset/calm-jars-wear.md +++ b/.changeset/brown-grapes-fold.md @@ -2,4 +2,4 @@ '@backstage/plugin-auth-backend-module-auth0-provider': minor --- -Set invitation query parameter as authorizationParam when present +feat: Add support for organizational invites in auth0 strategy diff --git a/plugins/auth-backend-module-auth0-provider/src/strategy.ts b/plugins/auth-backend-module-auth0-provider/src/strategy.ts index c2eb2a283c..f45e672556 100644 --- a/plugins/auth-backend-module-auth0-provider/src/strategy.ts +++ b/plugins/auth-backend-module-auth0-provider/src/strategy.ts @@ -51,15 +51,16 @@ export class Auth0Strategy extends Auth0InternalStrategy { authenticate(req: express.Request, options: Record): void { super.authenticate(req, { ...options, - invitation: req.query.invitation?.toString(), + organization: req.query.organization, + invitation: req.query.invitation, }); } authorizationParams(options: Record): Record { const params = super.authorizationParams(options); - if (this.organization) { - params.organization = this.organization; + if (options.organization || this.organization) { + params.organization = options.organization || this.organization; } if (options.invitation) {