modernize the codebase

Run the modernize linter across the codebase.
Change generated by running:

```
go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...
```

Ref:
https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize
This commit is contained in:
2025-09-23 09:13:29 +03:30
parent fc1502c4a0
commit 94694741a7
5 changed files with 33 additions and 38 deletions
+4 -4
View File
@@ -10,9 +10,9 @@ import (
)
type OauthLoginHandler struct {
jwt *auth.JwtTokenGenerator
jwt *auth.JwtTokenGenerator
oauthHandler *auth.GiteaOAuth2Handler
cfg *config.Config
cfg *config.Config
}
func NewOauthLoginHandler(
@@ -55,7 +55,7 @@ func (olh *OauthLoginHandler) LoginWithGitea(c *gin.Context) {
// Check if the user's email is in the allowed list
for _, email := range olh.cfg.GiteaOauthAllowedEmails {
if email == userEmail {
token, err := olh.jwt.GenerateToken(map[string]interface{}{"role": "admin"})
token, err := olh.jwt.GenerateToken(map[string]any{"role": "admin"})
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "Token generation failed"})
return
@@ -70,4 +70,4 @@ func (olh *OauthLoginHandler) LoginWithGitea(c *gin.Context) {
c.JSON(401, gin.H{
"error": "oauth login failed or your email does not have access",
})
}
}