From bc0d2c8ada14eae81542f30a81552ed5cef8bd5d Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sun, 13 Mar 2022 17:40:47 +0100 Subject: RSS/Atom support for Repos (#19055) * support for repos * refactor * advertise the feeds via meta tags * allow feed suffix and feed header * optimize performance --- modules/auth/pam/pam.go | 6 +++--- modules/context/repo.go | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/auth/pam/pam.go b/modules/auth/pam/pam.go index 0a3d8e9f91..1acd0b112c 100644 --- a/modules/auth/pam/pam.go +++ b/modules/auth/pam/pam.go @@ -34,10 +34,10 @@ func Auth(serviceName, userName, passwd string) (string, error) { if err = t.Authenticate(0); err != nil { return "", err } - + if err = t.AcctMgmt(0); err != nil { - return "", err - } + return "", err + } // PAM login names might suffer transformations in the PAM stack. // We should take whatever the PAM stack returns for it. diff --git a/modules/context/repo.go b/modules/context/repo.go index 355c40af8a..e55c13f49c 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -418,6 +418,8 @@ func RepoAssignment(ctx *Context) (cancel context.CancelFunc) { userName := ctx.Params(":username") repoName := ctx.Params(":reponame") repoName = strings.TrimSuffix(repoName, ".git") + repoName = strings.TrimSuffix(repoName, ".rss") + repoName = strings.TrimSuffix(repoName, ".atom") // Check if the user is the same as the repository owner if ctx.IsSigned && ctx.User.LowerName == strings.ToLower(userName) { -- cgit v1.2.3