aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api/handler_wrapper.go
diff options
context:
space:
mode:
authornsfisis <54318333+nsfisis@users.noreply.github.com>2026-02-21 09:35:03 +0900
committerGitHub <noreply@github.com>2026-02-21 09:35:03 +0900
commitaa25d66376f30c590c697a2c7eb981a24e1057bb (patch)
treecd6dc50573a90bb2625df981b8c9305c63f156c0 /backend/api/handler_wrapper.go
parent00354d392a0bcddaac71fee7b6aae721e5747f59 (diff)
parent277c9726f0f39d1db83624a8b62a77ac19c2ac0a (diff)
downloadphperkaigi-2026-albatross-aa25d66376f30c590c697a2c7eb981a24e1057bb.tar.gz
phperkaigi-2026-albatross-aa25d66376f30c590c697a2c7eb981a24e1057bb.tar.zst
phperkaigi-2026-albatross-aa25d66376f30c590c697a2c7eb981a24e1057bb.zip
Merge pull request #6 from nsfisis/claude/allow-viewing-without-login-zODtV
Allow unauthenticated users to view games and watch matches
Diffstat (limited to 'backend/api/handler_wrapper.go')
-rw-r--r--backend/api/handler_wrapper.go35
1 files changed, 5 insertions, 30 deletions
diff --git a/backend/api/handler_wrapper.go b/backend/api/handler_wrapper.go
index 48a0eef..1c8bc83 100644
--- a/backend/api/handler_wrapper.go
+++ b/backend/api/handler_wrapper.go
@@ -28,12 +28,7 @@ func NewHandler(queries db.Querier, txm db.TxManager, hub GameHubInterface, auth
}
func (h *HandlerWrapper) GetGame(ctx context.Context, request GetGameRequestObject) (GetGameResponseObject, error) {
- user, ok := GetUserFromContext(ctx)
- if !ok {
- return GetGame401JSONResponse{
- Message: "Unauthorized",
- }, nil
- }
+ user, _ := GetUserFromContext(ctx)
return h.impl.GetGame(ctx, request, user)
}
@@ -58,32 +53,17 @@ func (h *HandlerWrapper) GetGamePlaySubmissions(ctx context.Context, request Get
}
func (h *HandlerWrapper) GetGameWatchLatestStates(ctx context.Context, request GetGameWatchLatestStatesRequestObject) (GetGameWatchLatestStatesResponseObject, error) {
- user, ok := GetUserFromContext(ctx)
- if !ok {
- return GetGameWatchLatestStates401JSONResponse{
- Message: "Unauthorized",
- }, nil
- }
+ user, _ := GetUserFromContext(ctx)
return h.impl.GetGameWatchLatestStates(ctx, request, user)
}
func (h *HandlerWrapper) GetGameWatchRanking(ctx context.Context, request GetGameWatchRankingRequestObject) (GetGameWatchRankingResponseObject, error) {
- user, ok := GetUserFromContext(ctx)
- if !ok {
- return GetGameWatchRanking401JSONResponse{
- Message: "Unauthorized",
- }, nil
- }
+ user, _ := GetUserFromContext(ctx)
return h.impl.GetGameWatchRanking(ctx, request, user)
}
func (h *HandlerWrapper) GetGames(ctx context.Context, request GetGamesRequestObject) (GetGamesResponseObject, error) {
- user, ok := GetUserFromContext(ctx)
- if !ok {
- return GetGames401JSONResponse{
- Message: "Unauthorized",
- }, nil
- }
+ user, _ := GetUserFromContext(ctx)
return h.impl.GetGames(ctx, request, user)
}
@@ -98,12 +78,7 @@ func (h *HandlerWrapper) GetMe(ctx context.Context, request GetMeRequestObject)
}
func (h *HandlerWrapper) GetTournament(ctx context.Context, request GetTournamentRequestObject) (GetTournamentResponseObject, error) {
- user, ok := GetUserFromContext(ctx)
- if !ok {
- return GetTournament401JSONResponse{
- Message: "Unauthorized",
- }, nil
- }
+ user, _ := GetUserFromContext(ctx)
return h.impl.GetTournament(ctx, request, user)
}