From 5111b87f250d285348af34e8c121b571335ec80d Mon Sep 17 00:00:00 2001 From: viehlieb Date: Tue, 7 Nov 2023 15:24:23 +0100 Subject: [PATCH] fix typos --- pkg/models/error.go | 6 +++--- pkg/modules/auth/openid/openid.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/models/error.go b/pkg/models/error.go index dab4d178e..92848fb79 100644 --- a/pkg/models/error.go +++ b/pkg/models/error.go @@ -1162,7 +1162,7 @@ func IsErrOIDCTeamDoesNotExist(err error) bool { // ErrTeamDoesNotExist represents an error where a team does not exist func (err ErrOIDCTeamDoesNotExist) Error() string { - return fmt.Sprintf("No Team with that name and valid oidcId could be found. [Team Name: %v] [OidcId : %v] ", err.Name, err.OidcID) + return fmt.Sprintf("No team with that name and valid oidcId could be found. [Team Name: %v] [OidcID : %v] ", err.Name, err.OidcID) } // ErrCodeTeamDoesNotExist holds the unique world-error code of this error @@ -1170,7 +1170,7 @@ const ErrCodeOIDCTeamDoesNotExist = 6008 // HTTPError holds the http error description func (err ErrOIDCTeamDoesNotExist) HTTPError() web.HTTPError { - return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No Team with that name and valid oidcId could be found."} + return web.HTTPError{HTTPCode: http.StatusNotFound, Code: ErrCodeTeamDoesNotExist, Message: "No team with that name and valid oidcId could be found."} } // ErrOIDCTeamsDoNotExistForUser represents an error where an oidcTeam does not exist for the user @@ -1185,7 +1185,7 @@ func IsErrOIDCTeamsDoNotExistForUser(err error) bool { } func (err ErrOIDCTeamsDoNotExistForUser) Error() string { - return fmt.Sprintf("No Teams with property oidcId could be found for User [User ID: %d]", err.UserID) + return fmt.Sprintf("No teams with property oidcId could be found for user [User ID: %d]", err.UserID) } // ErrCodeTeamDoesNotExist holds the unique world-error code of this error diff --git a/pkg/modules/auth/openid/openid.go b/pkg/modules/auth/openid/openid.go index b0c655eaa..ab4a2b77f 100644 --- a/pkg/modules/auth/openid/openid.go +++ b/pkg/modules/auth/openid/openid.go @@ -207,7 +207,7 @@ func HandleCallback(c echo.Context) error { //find old teams for user through oidc oldOidcTeams, err := models.FindAllOidcTeamIDsForUser(s, u.ID) if err != nil { - log.Errorf("No Oidc Teams found for user %v", err) + log.Errorf("No oidc teams found for user %v", err) } oidcTeams, err := AssignOrCreateUserToTeams(s, u, teamData) if err != nil { @@ -215,13 +215,13 @@ func HandleCallback(c echo.Context) error { } errs = RemoveUserFromTeamsByIds(s, u, utils.NotIn(oldOidcTeams, oidcTeams)) for _, err := range errs { - log.Errorf("Found Error while signing out from teams %v", err) + log.Errorf("Found error while leaving teams %v", err) } } err = s.Commit() if err != nil { _ = s.Rollback() - log.Errorf("Error creating new Team for provider %s: %v", provider.Name, err) + log.Errorf("Error creating new team for provider %s: %v", provider.Name, err) return handler.HandleHTTPError(err, c) } // Create token @@ -327,7 +327,7 @@ func GetOrCreateTeamsByOIDCAndNames(s *xorm.Session, teamData []models.OIDCTeamD for _, oidcTeam := range teamData { team, err := models.GetTeamByOidcIDAndName(s, oidcTeam.OidcID, oidcTeam.TeamName) if err != nil { - log.Debugf("Team with oidc_id %v and name %v does not exist. Create Team.. ", oidcTeam.OidcID, oidcTeam.TeamName) + log.Debugf("Team with oidc_id %v and name %v does not exist. Creating team.. ", oidcTeam.OidcID, oidcTeam.TeamName) newTeam, err := CreateTeamWithData(s, oidcTeam, u) if err != nil { return te, err