From 7c6804c2af405abd3ff15aaa5b5fa498ae2cbd5b Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 1 Feb 2021 20:12:41 -0500 Subject: [PATCH] Use username if display name is blank (#11) --- src/JobsJobsJobs/Server/Auth.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/JobsJobsJobs/Server/Auth.cs b/src/JobsJobsJobs/Server/Auth.cs index 4931636..020617b 100644 --- a/src/JobsJobsJobs/Server/Auth.cs +++ b/src/JobsJobsJobs/Server/Auth.cs @@ -80,6 +80,13 @@ namespace JobsJobsJobs.Server $"Profiles must be from noagendasocial.com; yours is {profileResponse.AccountName}"); } + // If the user hasn't filled in a display name, use the username as the display name. + // (this is what Mastodon does) + if (string.IsNullOrWhiteSpace(profileResponse.DisplayName)) + { + profileResponse.DisplayName = profileResponse.Username; + } + return Result.AsOk(profileResponse); }