aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/api/handler.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-09 23:30:10 +0900
committernsfisis <nsfisis@gmail.com>2024-08-09 23:30:10 +0900
commitaf36c59851399194bcbb77a3093d46c2757cb7b4 (patch)
tree72e1a3cc00044f9c00dc5f22ef9325124f272401 /backend/api/handler.go
parent93f2ffc18d1d86bd2999533e8d904c92cb29bc1a (diff)
downloadphperkaigi-2025-albatross-af36c59851399194bcbb77a3093d46c2757cb7b4.tar.gz
phperkaigi-2025-albatross-af36c59851399194bcbb77a3093d46c2757cb7b4.tar.zst
phperkaigi-2025-albatross-af36c59851399194bcbb77a3093d46c2757cb7b4.zip
feat: support authentication via fortee
Diffstat (limited to 'backend/api/handler.go')
-rw-r--r--backend/api/handler.go5
1 files changed, 4 insertions, 1 deletions
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",