fix device decrypt flow and delete_account response stability
Build docker and publish / build (20.15.1) (push) Failing after 8m0s

This commit is contained in:
2026-03-04 01:36:45 -08:00
parent 8bdc8afea3
commit 82626dd749
7 changed files with 143 additions and 5 deletions
+15 -4
View File
@@ -41,10 +41,7 @@ func AuthMiddleware(svc *svc.ServiceContext) func(c *gin.Context) {
return
}
loginType := ""
if claims["CtxLoginType"] != nil {
loginType = claims["CtxLoginType"].(string)
}
loginType := parseLoginType(claims)
if claims["identifier"] != nil {
ctx = context.WithValue(ctx, constant.CtxKeyIdentifier, claims["identifier"].(string))
}
@@ -93,3 +90,17 @@ func AuthMiddleware(svc *svc.ServiceContext) func(c *gin.Context) {
c.Next()
}
}
func parseLoginType(claims map[string]interface{}) string {
if raw, exists := claims["CtxLoginType"]; exists {
if loginType, ok := raw.(string); ok && loginType != "" {
return loginType
}
}
if raw, exists := claims["LoginType"]; exists {
if loginType, ok := raw.(string); ok && loginType != "" {
return loginType
}
}
return ""
}