feat(mobile): only allow request from mobile client to copy session

This commit is contained in:
HFO4
2022-12-19 17:35:39 +08:00
parent e4c87483d6
commit bc0c374f00
3 changed files with 21 additions and 2 deletions

View File

@@ -395,5 +395,4 @@ func UserPerformCopySession(c *gin.Context) {
} else {
c.JSON(200, ErrorResponse(err))
}
}

View File

@@ -234,7 +234,12 @@ func InitMasterRouter() *gin.Engine {
file.GET("archive/:sessionID/archive.zip", controllers.DownloadArchive)
}
sign.GET("user/session/copy/:id", controllers.UserPerformCopySession)
// Copy user session
sign.GET(
"user/session/copy/:id",
middleware.MobileRequestOnly(),
controllers.UserPerformCopySession,
)
}
// 从机的 RPC 通信