[bugfix] Suggest lowercase username when creating via OIDC (#3780)

This commit is contained in:
tobi
2025-02-11 09:42:35 +01:00
committed by GitHub
parent 4ac5447ad6
commit 2c95fd4115
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,
},
}