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

fix: dont require server config base url on login #3375

Merged
merged 4 commits into from
Oct 14, 2022

Conversation

BruceMacD
Copy link
Collaborator

Summary

When no server URL is set in server configuration set the default server URL to the current host on response. This allows the login response to continue when the optional baseURL server configuration is not set, but it also ensures that we wait until we have checked the server to see if there is one set.

Checklist

  • Considered security implications of the change
  • Change is backwards compatible if it needs to be (user can upgrade without manual steps?)
  • Nothing sensitive logged

Related Issues

Resolves #3374

ui/lib/serverconfig.js Outdated Show resolved Hide resolved
let cookieDomain = window.location.host
let parts = cookieDomain.split('.')
if (parts.length > 2) {
cookieDomain = parts.slice(-2).join('.') // join the last two parts of the domain
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, would it be better to set it to all but the first part? e.g. myorg.dev.test.com may not work here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The "last 2 parts" here would be test.com which in my tests gets the behavior we want of sending the cookie on any domain at test.com/login/organizations.

Screen Shot 2022-10-04 at 10 40 14 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this to just remove the first part that is the org subdomain, this will work in dev and prod as you pointed out

@BruceMacD BruceMacD force-pushed the brucemacd/optional-login-base-domain branch from 8bfbf1a to 7d0828d Compare October 6, 2022 13:59
@BruceMacD BruceMacD force-pushed the brucemacd/optional-login-base-domain branch from 7b9958f to af1201d Compare October 14, 2022 20:32
@BruceMacD BruceMacD merged commit d066e27 into main Oct 14, 2022
@BruceMacD BruceMacD deleted the brucemacd/optional-login-base-domain branch October 14, 2022 20:49
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.

UI requires base domain to be set or login gets stuck at spinner
3 participants