Repository navigation
Enabling POD providers to enforce a Terms & Conditions - #892
Conversation
|
This is a fix for #799 |
Co-Authored-By: megoth <arne.hassel@gmail.com>
…/node-solid-server into feature/blacklist-username
A simple service for handling blacklisting of usernames
| <div class="checkbox"> | ||
| <label> | ||
| <input type="checkbox" name="acceptToc"> | ||
| I agree to the <a href="{{tocUri}}" target="_blank">Terms & Conditions</a> of this service |
|
|
||
| this.username = options.username | ||
| this.userAccount = options.userAccount | ||
| this.acceptToc = options.acceptToc === 'true' |
There was a problem hiding this comment.
should that parsing be this constructor's job?
There was a problem hiding this comment.
Probably fromParams (even though the whole fromParams pattern all over is a disease)
| } | ||
|
|
||
| if (this.enforceToc && !this.acceptToc) { | ||
| error = new Error('Accepting Terms & Conditions are required for this service') |
| error = new Error('Accepting Terms & Conditions are required for this service') | ||
| error.statusCode = 400 | ||
| throw error | ||
| } |
There was a problem hiding this comment.
They are two different classes, so think I'll let it be as is.
But we might want to separate these classes a bit more in the future, i.e. having them in separate files. create-account-request is getting difficult to read.
|
@rubensworks Then I think I've fixed all the nits ^_^ Does it look ok? |
|
@megoth Wrong Ruben, |
|
Hah, sorry about that, did it a little bit fast here =P @RubenVerborgh does the changes look good? |
|
I don't have access to security/snyk, so I'm unable to see what stops it |
To make it easier for POD-providers to update their own config.json files
|
@megoth You can make your own Snyk account to see it. |
|
Fine with me. |
Also added handlebar-helpers
To make it easier for POD-providers to update their own config.json files
…d-server into feature/link-toc
|
I decided to remove handlebars-helpers because of a vulnerability it introduced (note to self: check snyk and npm audit when adding new dependencies). |
I've also added handlebars-helpers, but right now it's only used one place, so I understand if I should revert it. But I think it can be a useful tool once our templates grow more complex.
Apart from that there are some unnecessary changes, i.e. cleaning up some code and introducing some async/await, that I also can revert if needed.