feat: redirect to frontend landing page

This commit is contained in:
Paul Pan 2024-01-05 15:47:29 +08:00
parent d45d958ea1
commit 1cd3620bdb
Signed by: Paul
GPG Key ID: D639BDF5BA578AF4

View File

@ -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})
}
}