[bugfix] Suggest lowercase username when creating via OIDC

This commit is contained in:
tobi 2025-02-11 09:28:46 +01:00
commit a3c9521d41
2 changed files with 8 additions and 2 deletions

View file

@ -145,12 +145,18 @@ func (m *Module) CallbackGETHandler(c *gin.Context) {
return
}
// Since we require lowercase usernames at this point, lowercase the one
// from the claims and use this to autofill the form with a suggestion.
//
// Pending https://github.com/superseriousbusiness/gotosocial/issues/1813
suggestedUsername := strings.ToLower(claims.PreferredUsername)
page := apiutil.WebPage{
Template: "finalize.tmpl",
Instance: instance,
Extra: map[string]any{
"name": claims.Name,
"preferredUsername": claims.PreferredUsername,
"suggestedUsername": suggestedUsername,
},
}