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 bugs with URL overrides in Connect window #2702

Merged
merged 3 commits into from
Aug 15, 2018
Merged

Conversation

astorije
Copy link
Member

Follow-up of 94f1d8d and probably another commit.

💥 3 bug fixes for the price of 1! 💥

1. Disallow URL override of network-related fields on the client when the network is locked

Before After
screen shot 2018-08-11 at 18 16 38 screen shot 2018-08-11 at 18 16 47

2. Pass network name along to the client connect window when network is locked and not displayed

Before After
screen shot 2018-08-11 at 18 08 00 screen shot 2018-08-11 at 18 09 40

3. Make sure the network name cannot be changed through URL override when the network info is not displayed

Before After
screen shot 2018-08-11 at 18 10 37 screen shot 2018-08-11 at 18 11 20

@astorije astorije added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Aug 11, 2018
@astorije astorije added this to the 3.0.0 milestone Aug 11, 2018
continue;
}

// When the network is not displayed, its name in the UI is not customizable
Copy link
Member

@xPaw xPaw Aug 12, 2018

Choose a reason for hiding this comment

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

I believe this is not enforced on the server.

Setting displayNetwork to false, automatically sets lockNetwork to true. But neither of these options enforce the lock on name.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mmmh, indeed. Anything (simple if possible) I need to add to this PR? Or for later?
It's plain weird that we can change the name on the title from the URL when not displayed (and a regression) but I see what you're saying.

Copy link
Member

@xPaw xPaw Aug 15, 2018

Choose a reason for hiding this comment

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

Hm. I think this if you added isn't even needed because you shouldn't have added name on the server in getClientConfiguration.

Server defaults to defaults.name if none provided here and displayNetwork is false: https://github.com/thelounge/thelounge/blob/master/src/client.js#L204

Technically it's still possible to directly send a name by modifying the form in devtools, but overriding the URL shouldn't work?

EDIT: Damn it, you added it because it's displayed.

@xPaw xPaw merged commit c9ba896 into master Aug 15, 2018
@xPaw xPaw deleted the astorije/connect-override branch August 15, 2018 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants