Prevent entryCreateUser from being used when forbidClientAccountCreation is enabled#269
Prevent entryCreateUser from being used when forbidClientAccountCreation is enabled#269ameagher wants to merge 3 commits intoDifferential:masterfrom
Conversation
client/views/signUp/signUp.coffee
Outdated
There was a problem hiding this comment.
Why are you logging the error on the client side?
There was a problem hiding this comment.
In the code? It's not my doing. That's from the master branch: signUp.coffee#L160
I just added a conditional at the top and added an indent to all these lines, that's why they're modified (If there's a way to prevent that I'd like to know!)
There was a problem hiding this comment.
Github is doing a poor job of showing the diff. It is matching original line 152 with new line 143, when it should be 153 (I only added one line)
|
Thanks for the PR. Can we move the if checks inside the code instead of wrapping up global method setting in a big if statement? e.g. Please make sure the methods still exist, just return out of them and do nothing if forbidClientAccountCreation is set to true. |
…preventing their declarations.
|
How's this? I believe the test is failing because the package itself is failing? |
|
I'm not concerned about the failing test, just stating my preference in how the code should be structure. Looking at it again, perhaps this is the best way, I will take a look at it some more. |
|
My most recent changes approached this a different way, and the code does look cleaner. My original thought was to prevent the functions from being available entirely, but as long as random visitors can't create accounts I'm happy. |
|
Hey guy's. Any update on this PR? Functionality to prevent sign up's seems pretty vital. |
Even when forbidClientAccountCreation was enabled users could still be added from the client if you manually went to the /sign-up route, or by calling entryCreateUser from the console:
This commit disables the entryCreateUser method when forbidClientAccountCreation is enabled.