mirror of
https://github.com/thomiceli/opengist.git
synced 2025-07-12 19:01:50 +02:00
Add require login feature to see gists
This commit is contained in:
@ -47,9 +47,10 @@ func gitHttp(ctx echo.Context) error {
|
||||
|
||||
gist := getData(ctx, "gist").(*models.Gist)
|
||||
|
||||
noAuth := ctx.QueryParam("service") == "git-upload-pack" ||
|
||||
noAuth := (ctx.QueryParam("service") == "git-upload-pack" ||
|
||||
strings.HasSuffix(ctx.Request().URL.Path, "git-upload-pack") ||
|
||||
ctx.Request().Method == "GET"
|
||||
ctx.Request().Method == "GET") &&
|
||||
!getData(ctx, "RequireLogin").(bool)
|
||||
|
||||
repositoryPath := git.RepositoryPath(gist.User.Username, gist.Uuid)
|
||||
|
||||
|
Reference in New Issue
Block a user