Skip to content

Commit 6b3204a

Browse files
authored
refactor: move db and proxy logic to ui & implement deepseek (#6)
1 parent 584c19d commit 6b3204a

File tree

26 files changed

+964
-1479
lines changed

26 files changed

+964
-1479
lines changed

service/server/auth.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,25 +139,26 @@ func handleRegister(c *gin.Context) {
139139

140140
func RequireUserLogin() gin.HandlerFunc {
141141
return func(c *gin.Context) {
142+
if c.Request.Method == "OPTIONS" {
143+
c.Next()
144+
return
145+
}
142146
authHeader := c.GetHeader("Authorization")
143147
if authHeader == "" {
144-
c.Header("X-Uni-Token-Error", "missing_authorization_header")
145148
c.Status(http.StatusUnauthorized)
146149
c.Abort()
147150
return
148151
}
149152

150153
tokenParts := strings.Split(authHeader, " ")
151154
if len(tokenParts) != 2 || tokenParts[0] != "Bearer" {
152-
c.Header("X-Uni-Token-Error", "missing_authorization_header")
153155
c.Status(http.StatusUnauthorized)
154156
c.Abort()
155157
return
156158
}
157159

158160
claims, err := logic.ValidateJWT(tokenParts[1])
159161
if err != nil {
160-
c.Header("X-Uni-Token-Error", "invalid_token")
161162
c.Status(http.StatusUnauthorized)
162163
c.Abort()
163164
return

service/server/deep-seek/deep-seek.go

Lines changed: 0 additions & 240 deletions
This file was deleted.

0 commit comments

Comments
 (0)