# Validate Custom User Field for Fediverse Handle

**URL:** https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037
**Category:** Support
**Tags:** user-custom-fields
**Created:** [July 4, 2024, 6:25pm UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037 "2024-07-04T18:25:46Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cogdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cogdog/32/116536_2.png) [@cogdog](https://meta.discourse.org/u/cogdog)
#### Post date: [July 4, 2024, 6:25pm UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037/1 "2024-07-04T18:25:46Z")

</div>

Yes, I have searched and found [one general method for validating the input to a custom user field](https://meta.discourse.org/t/custom-user-fields-field-verification/109574/12). My skills here are a bit raw, so hoping for suggestions.

We’ve been encouraging people in our education community to include in their profile a username if they have a fediverse account (Mastodon, Bluesky, Threads, et al). These should be something with two @ signs, where the first is a username and the second a valid formatted domain.

```
 @coolperson99@someinstance.org

```

Despite what I thought was a clearly explained format:

 ![Fediverse User Name: Enter identity in a federated social network such as Mastodon, BlueSky, Threads, etc. Entries must in format @username@instance.name please only enter valid account names!](https://global.discourse-cdn.com/meta/original/4X/f/0/1/f01613e1bccb588f1cc77c17a0e87d47f790d05f.jpeg)

The successful entry rate is like 20% or worse. I get email addresses, twitter usernames, random strings, URLs. I can only dream, but think it should be possible to check with some regex (again my skills are mid range to muddling) for the valid format.

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 4, 2024, 6:58pm UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037/2 "2024-07-04T18:58:49Z")

</div>

This plugin maybe of interest if you’re self hosted or on a Hosted plan that includes it

> [@Discourse Authentication Validations](https://meta.discourse.org/t/discourse-authentication-validations/292547):
>
> discourse2Summary Discourse Authentication Validations enables the ability to add custom validations to a User Field to toggle the display of User Fields on the Signup Modal.hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-authentication-validations](https://github.com/discourse/discourse-authentication-validations)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)information_source About Discourse Authentication Validations adds the ability to add custom validations to a User Field. Custom User Fi…

This #Customization > Theme component maybe also of interest as well. This of course can be installed on any discourse install.

> [@Clickable Social Icon Links on Profile](https://meta.discourse.org/t/clickable-social-icon-links-on-profile/158136):
>
> A Theme Component that includes social icons as clickable within User Profile & User Cards if you are using the [User Cards Directory Theme Component](https://meta.discourse.org/t/user-card-directory/144479/29) It’s 99% copied from the discussion & code samples provided by @LeoMcA included in this conversation on [Meta](https://meta.discourse.org/t/link-custom-user-field-to-external-website/41218) and in [Namati User Card Profile Theme](https://github.com/LeoMcA/namati-user-card-profile-theme), but thought it would be helpful to dig it out from the thread and make it slightly more general. Notes Any users that don’t include a value for an entry will…

---

<div class="post-metadata">

### Author: ![cogdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cogdog/32/116536_2.png) [@cogdog](https://meta.discourse.org/u/cogdog)
#### Post date: [July 4, 2024, 10:35pm UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037/3 "2024-07-04T22:35:35Z")

</div>

Thanks Dan, the Discourse Authentication Validations plugin looks perfect and useful for my other fields.

I am already using Clickable Social Icon Links. I can see my mistake was asking for a mastodon username rather than a URL, so it looks like I have some cleanup to do!

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [July 5, 2024, 1:01am UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037/4 "2024-07-05T01:01:55Z")

</div>

You’re quite welcome!

Just found this #Customization > Theme component that you might also find very useful.

You could create a post with fields that need correcting with providing format details/pic.

> [@User Field Prompt](https://meta.discourse.org/t/user-field-prompt/185214):
>
> discourse2Summary User Field Prompt allows you to show a [user field](https://meta.discourse.org/t/how-to-create-and-configure-custom-user-fields/113192) form in any Discourse post.eyeglassesPreview [Preview on Discourse Theme Creator](https://discourse.theme-creator.io/theme/Discourse/user-field-prompt)hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-user-field-prompt](https://github.com/discourse/discourse-user-field-prompt)open_bookNew to Discourse Themes? [Beginner’s guide to using Discourse Themes](https://meta.discourse.org/t/beginners-guide-to-using-discourse-themes/91966) Install this theme component Features User Field Prompt allows you to show a [user field](https://meta.discourse.org/t/how-to-create-and-configure-custom-user-fields/113192) form in any Discourse post. Changes made in the form will …

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 4, 2024, 1:02am UTC](https://meta.discourse.org/t/validate-custom-user-field-for-fediverse-handle/315037/5 "2024-08-04T01:02:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
