Forbid creating usernames with uppercase characters

We don't actually enforce anything on the ActivityPub level, only
user-facing interfaces

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-17 19:14:55 +01:00
parent c28dae45bb
commit e6077d0dc3
55 changed files with 6436 additions and 4808 deletions

View File

@@ -26,12 +26,21 @@
:type="errors.preferred_username ? 'is-danger' : null"
:message="errors.preferred_username"
>
<b-field>
<b-field
:message="
$t('Only alphanumeric lowercased characters and underscores are supported.')
"
>
<b-input
aria-required="true"
required
expanded
v-model="identity.preferredUsername"
:validation-message="
identity.preferredUsername
? $t('Only alphanumeric lowercased characters and underscores are supported.')
: null
"
/>
<p class="control">
<span class="button is-static">@{{ host }}</span>
@@ -164,7 +173,7 @@ export default class Register extends mixins(identityEditionMixin) {
} catch (errorCatched) {
this.errors = errorCatched.graphQLErrors.reduce(
(acc: { [key: string]: string }, error: any) => {
acc[error.details] = error.message;
acc[error.details || error.field] = error.message;
return acc;
},
{}

View File

@@ -181,7 +181,9 @@ export default class EditIdentity extends mixins(identityEditionMixin) {
get message(): string | null {
if (this.isUpdate) return null;
return this.$t("Only alphanumeric characters and underscores are supported.") as string;
return this.$t(
"Only alphanumeric lowercased characters and underscores are supported."
) as string;
}
get avatarUrl(): string | null {