wip: 继续, client, svc 同步进行

This commit is contained in:
loveuer
2024-10-28 22:37:22 +08:00
parent d1597509bb
commit c696872b8a
6 changed files with 92 additions and 23 deletions

View File

@ -5,6 +5,7 @@ import (
"errors"
"github.com/google/uuid"
"github.com/loveuer/nf"
"github.com/loveuer/nf/nft/log"
"github.com/loveuer/nf/nft/resp"
"gorm.io/gorm"
"net/http"
@ -27,6 +28,7 @@ func Authorize(c *nf.Ctx) error {
ResponseType string `query:"response_type"`
RedirectURI string `query:"redirect_uri"`
Scope string `query:"scope"`
State string `query:"state"`
}
var (
@ -39,7 +41,8 @@ func Authorize(c *nf.Ctx) error {
)
if err = c.QueryParser(req); err != nil {
return resp.Resp400(c, err)
log.Error("[S] query parser err = %s", err.Error())
return c.Status(http.StatusBadRequest).SendString("Invalid request")
}
if req.ResponseType != "code" {