Skip to content

Commit

Permalink
Merge pull request #4786 from FlowFuse/4784-modify-invite-text-for-sso
Browse files Browse the repository at this point in the history
Modify invite link for SSO enabled external users
  • Loading branch information
hardillb authored Nov 15, 2024
2 parents 2fc508e + d4318e2 commit 9c1babb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion forge/routes/api/teamInvitations.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,20 @@ module.exports = async function (app) {
// controllers.Invitation.createInvitations will have already
// rejected external requests if team:user:invite:external set to false
if (invite.external) {
let signupLink = `${app.config.base_url}/account/create?email=${encodeURIComponent(invite.email)}`
if (app.license.active()) {
// Check if this is for an SSO-enabled domain with auto-create turned on
const providerConfig = await app.db.models.SAMLProvider.forEmail(invite.email)
if (providerConfig?.options?.provisionNewUsers) {
signupLink = `${app.config.base_url}`
}
}
await app.postoffice.send(
invite,
'UnknownUserInvitation',
{
invite,
signupLink: `${app.config.base_url}/account/create?email=${encodeURIComponent(invite.email)}`
signupLink
}
)
await app.auditLog.Team.team.user.invited(request.session.User, null, request.team, invite, role)
Expand Down

0 comments on commit 9c1babb

Please sign in to comment.