From 1cd3620bdb42047cc326f97e1c29572d37eda4d1 Mon Sep 17 00:00:00 2001 From: Paul Pan Date: Fri, 5 Jan 2024 15:47:29 +0800 Subject: [PATCH] feat: redirect to frontend landing page --- internal/api/oauth/callback.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/api/oauth/callback.go b/internal/api/oauth/callback.go index d9e2513..d8377db 100644 --- a/internal/api/oauth/callback.go +++ b/internal/api/oauth/callback.go @@ -3,11 +3,11 @@ package oauth import ( "context" "fmt" - userApi "git.0x7f.app/WOJ/woj-server/internal/api/user" "git.0x7f.app/WOJ/woj-server/internal/e" "git.0x7f.app/WOJ/woj-server/internal/model" "git.0x7f.app/WOJ/woj-server/internal/service/user" "github.com/gin-gonic/gin" + "net/http" ) // CallbackHandler @@ -109,6 +109,8 @@ func (h *handler) CallbackHandler() gin.HandlerFunc { return } - e.Pong(c, status, userApi.LoginResponse{Token: jwt, NickName: u.NickName}) + // TODO: Figure out a better way to cooperate with frontend + c.Redirect(http.StatusFound, "/login?redirect_token="+jwt) + // e.Pong(c, status, userApi.LoginResponse{Token: jwt, NickName: u.NickName}) } }