Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow specified org domain on sign up #2978

Merged
merged 2 commits into from
Aug 22, 2022

Conversation

BruceMacD
Copy link
Collaborator

Summary

When a new organization signs up or is created by a support admin it should be possible to specify the org's subdomain or domain directly.

  • Allow specifying your organization's sub-domain on sign-up.
  • Allow support admins to directly specify an organization's full domain through the API. This may be useful as an admin workaround if we need a special domain. This is not a normal action.
  • Update the UI for specified organization domains.
  • Parse root errors from conflict error message trace for better error display.

Screen Shot 2022-08-19 at 7 40 37 AM

Screen Shot 2022-08-19 at 7 40 59 AM

Screen Shot 2022-08-19 at 7 56 14 AM

Checklist

  • Wrote appropriate unit tests
  • Considered security implications of the change
  • Updated associated docs where necessary
  • Updated associated configuration where necessary
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged
  • Considered data migrations for smooth upgrades

Related Issues

Resolves #2956


var domainNameReplacer = regexp.MustCompile(`[^\da-zA-Z-]`)

func SanitizedDomain(subDomain, serverBaseDomain string) string {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll update this when #2957 gets in

@@ -52,9 +53,15 @@ func sendAPIError(c *gin.Context, err error) {
case errors.As(err, &uniqueConstraintError):
resp.Code = http.StatusConflict
resp.Message = err.Error()
// remove the error trace from field error message
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents the error in the UI from displaying the full trace.

Ex:
An error message of sign-up: create org: duplicate domain becomes duplicate domain

@BruceMacD BruceMacD merged commit 2735a3d into main Aug 22, 2022
@BruceMacD BruceMacD deleted the brucemacd/custom_org_domain branch August 22, 2022 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow sign-up specified org domain
2 participants