Полный продовый фикс fix22: DNS preflight, inet firewall, idempotent bootstrap, auth-semantics и redact-config
This commit is contained in:
@@ -11,11 +11,16 @@ import (
|
||||
)
|
||||
|
||||
func Hysteria2Auth(c *gin.Context) {
|
||||
hysteria2AuthDto, err := validateField(c, dto.Hysteria2AuthDto{})
|
||||
if err != nil {
|
||||
var req dto.Hysteria2AuthDto
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
vo.Hysteria2AuthBadRequest(c)
|
||||
return
|
||||
}
|
||||
id, username, err := service.Hysteria2Auth(*hysteria2AuthDto.Auth)
|
||||
if req.Addr == nil || req.Auth == nil || req.Tx == nil {
|
||||
vo.Hysteria2AuthBadRequest(c)
|
||||
return
|
||||
}
|
||||
id, username, err := service.Hysteria2Auth(*req.Auth)
|
||||
if err != nil || username == "" {
|
||||
vo.Hysteria2AuthFail("", c)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user