2
0
Files
gitcaddy-server/routers/api/v2/misc.go
GitCaddy 14072ba013 chore: update copyright headers to MarketAlly
- New files: Copyright 2026 MarketAlly
- Modified files: Copyright YYYY The Gitea Authors and MarketAlly

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 22:56:56 +00:00

36 lines
786 B
Go

// Copyright 2026 MarketAlly. All rights reserved.
// SPDX-License-Identifier: MIT
package v2
import (
"net/http"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/services/context"
)
// VersionResponse contains version information
type VersionResponse struct {
Version string `json:"version"`
API string `json:"api"`
}
// Version returns the Gitea version
func Version(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, VersionResponse{
Version: setting.AppVer,
API: "v2",
})
}
// GetAuthenticatedUser returns the authenticated user
func GetAuthenticatedUser(ctx *context.APIContext) {
ctx.JSON(http.StatusOK, map[string]any{
"id": ctx.Doer.ID,
"login": ctx.Doer.Name,
"email": ctx.Doer.Email,
"is_admin": ctx.Doer.IsAdmin,
})
}