Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3524915
D8615.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8615.diff
View Options
diff --git a/keyserver/src/creators/invite-link-creator.js b/keyserver/src/creators/invite-link-creator.js
--- a/keyserver/src/creators/invite-link-creator.js
+++ b/keyserver/src/creators/invite-link-creator.js
@@ -8,6 +8,7 @@
} from 'lib/types/link-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { ServerError } from 'lib/utils/errors.js';
+import { reservedUsernamesSet } from 'lib/utils/reserved-users.js';
import createIDs from './id-creator.js';
import {
@@ -33,6 +34,9 @@
if (badWordsFilter.isProfane(request.name)) {
throw new ServerError('offensive_words');
}
+ if (reservedUsernamesSet.has(request.name)) {
+ throw new ServerError('link_reserved');
+ }
const permissionPromise = checkThreadPermission(
viewer,
diff --git a/lib/shared/invite-links.js b/lib/shared/invite-links.js
--- a/lib/shared/invite-links.js
+++ b/lib/shared/invite-links.js
@@ -1,9 +1,12 @@
// @flow
-const inviteLinkErrorMessages = {
+const inviteLinkErrorMessages: { +[string]: string } = {
invalid_characters: 'Link cannot contain any spaces or special characters.',
offensive_words: 'No offensive or abusive words allowed.',
already_in_use: 'Public link URL already in use.',
+ link_reserved:
+ 'This public link is currently reserved. Please contact support@' +
+ 'comm.app if you would like to claim this link.',
};
const defaultErrorMessage = 'Unknown error.';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 3:07 PM (8 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2700275
Default Alt Text
D8615.diff (1 KB)
Attached To
Mode
D8615: [keyserver][lib] Block users from creating reserved invite links
Attached
Detach File
Event Timeline
Log In to Comment