From f2f779e4a2d2d64594f87f93d21313fa6d9b9d0d Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 16 Jan 2020 12:24:10 -0500 Subject: [PATCH] Generate non-colliding usernames in all lowercase All usernames should be lowercase, so this generates any username suffix (in cases of collision) with only lowercase letters. It also removes vowels to prevent bad 5-letter words from forming. Ref T712 --- oauth_slack.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauth_slack.go b/oauth_slack.go index 8cf4992..f700c2c 100644 --- a/oauth_slack.go +++ b/oauth_slack.go @@ -157,7 +157,7 @@ func (c slackOauthClient) inspectOauthAccessToken(ctx context.Context, accessTok func (resp slackUserIdentityResponse) InspectResponse() *InspectResponse { return &InspectResponse{ UserID: resp.User.ID, - Username: fmt.Sprintf("%s-%s", slug.Make(resp.User.Name), store.Generate62RandomString(5)), + Username: fmt.Sprintf("%s-%s", slug.Make(resp.User.Name), store.GenerateRandomString("0123456789bcdfghjklmnpqrstvwxyz", 5)), DisplayName: resp.User.Name, Email: resp.User.Email, }