From af36c59851399194bcbb77a3093d46c2757cb7b4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Fri, 9 Aug 2024 23:30:10 +0900 Subject: feat: support authentication via fortee --- backend/api/handler.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'backend/api/handler.go') diff --git a/backend/api/handler.go b/backend/api/handler.go index 57d7464..23c3cfe 100644 --- a/backend/api/handler.go +++ b/backend/api/handler.go @@ -3,6 +3,7 @@ package api import ( "context" "errors" + "log" "net/http" "github.com/jackc/pgx/v5" @@ -24,8 +25,10 @@ type GameHubsInterface interface { func (h *Handler) PostLogin(ctx context.Context, request PostLoginRequestObject) (PostLoginResponseObject, error) { username := request.Body.Username password := request.Body.Password - userID, err := auth.Login(ctx, h.q, username, password) + registrationToken := request.Body.RegistrationToken + userID, err := auth.Login(ctx, h.q, username, password, registrationToken) if err != nil { + log.Printf("login failed: %v", err) return PostLogin401JSONResponse{ UnauthorizedJSONResponse: UnauthorizedJSONResponse{ Message: "Invalid username or password", -- cgit v1.2.3-70-g09d2